org.neuroph.core.learning
Class IterativeLearning

java.lang.Object
  extended by java.util.Observable
      extended by org.neuroph.core.learning.LearningRule
          extended by org.neuroph.core.learning.IterativeLearning
All Implemented Interfaces:
java.io.Serializable, java.lang.Runnable
Direct Known Subclasses:
SupervisedLearning, UnsupervisedLearning

public abstract class IterativeLearning
extends LearningRule
implements java.io.Serializable

Base class for all iterative learning algorithms. It provides the iterative learning procedure for all of its subclasses.

Author:
Zoran Sevarac
See Also:
Serialized Form

Field Summary
protected  int currentIteration
          Current iteration counter
protected  boolean iterationsLimited
          Flag for indicating if the training iteration number is limited
protected  double learningRate
          Learning rate parametar
protected  int maxIterations
          Max training iterations (when to stopLearning training)
 
Fields inherited from class org.neuroph.core.learning.LearningRule
neuralNetwork
 
Constructor Summary
IterativeLearning()
          Creates new instannce of IterativeLearning learning algorithm
IterativeLearning(NeuralNetwork network)
          Creates new instannce of IterativeLearning learning algorithm for the specified neural network.
 
Method Summary
abstract  void doLearningEpoch(TrainingSet trainingSet)
          Override this method to implement specific learning epoch - one learning iteration, one pass through whole training set
 void doOneLearningIteration(TrainingSet trainingSet)
          Runs one learning iteration for the specified training set and notfies observers.
 java.lang.Integer getCurrentIteration()
          Returns current iteration of this learning algorithm
 double getLearningRate()
          Returns learning rate for this algorithm
 boolean isPausedLearning()
          Returns true if learning thread is paused, false otherwise
 void learn(TrainingSet trainingSet)
          Override this method to implement specific learning procedures
 void learn(TrainingSet trainingSet, int maxIterations)
          Trains network for the specified training set and number of iterations
 void pause()
          Pause the learning
 void resume()
          Resumes the paused learning
 void setLearningRate(double learningRate)
          Sets learning rate for this algorithm
 void setMaxIterations(java.lang.Integer maxIterations)
          Sets iteration limit for this learning algorithm
 
Methods inherited from class org.neuroph.core.learning.LearningRule
getNeuralNetwork, getTrainingSet, isStopped, notifyChange, run, setNeuralNetwork, setTrainingSet, stopLearning
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

learningRate

protected double learningRate
Learning rate parametar


currentIteration

protected int currentIteration
Current iteration counter


maxIterations

protected int maxIterations
Max training iterations (when to stopLearning training)


iterationsLimited

protected boolean iterationsLimited
Flag for indicating if the training iteration number is limited

Constructor Detail

IterativeLearning

public IterativeLearning()
Creates new instannce of IterativeLearning learning algorithm


IterativeLearning

public IterativeLearning(NeuralNetwork network)
Creates new instannce of IterativeLearning learning algorithm for the specified neural network.

Parameters:
network - neural network to train
Method Detail

getLearningRate

public double getLearningRate()
Returns learning rate for this algorithm

Returns:
learning rate for this algorithm

setLearningRate

public void setLearningRate(double learningRate)
Sets learning rate for this algorithm

Parameters:
learningRate - learning rate for this algorithm

setMaxIterations

public void setMaxIterations(java.lang.Integer maxIterations)
Sets iteration limit for this learning algorithm

Parameters:
maxIterations - iteration limit for this learning algorithm

getCurrentIteration

public java.lang.Integer getCurrentIteration()
Returns current iteration of this learning algorithm

Returns:
current iteration of this learning algorithm

isPausedLearning

public boolean isPausedLearning()
Returns true if learning thread is paused, false otherwise

Returns:
true if learning thread is paused, false otherwise

pause

public void pause()
Pause the learning


resume

public void resume()
Resumes the paused learning


learn

public void learn(TrainingSet trainingSet)
Description copied from class: LearningRule
Override this method to implement specific learning procedures

Specified by:
learn in class LearningRule
Parameters:
trainingSet - training set

learn

public void learn(TrainingSet trainingSet,
                  int maxIterations)
Trains network for the specified training set and number of iterations

Parameters:
trainingSet - training set to learn
maxIterations - maximum numberof iterations to learn

doOneLearningIteration

public void doOneLearningIteration(TrainingSet trainingSet)
Runs one learning iteration for the specified training set and notfies observers. This method does the the doLearningEpoch() and in addtion notifes observrs when iteration is done.

Parameters:
trainingSet - training set to learn

doLearningEpoch

public abstract void doLearningEpoch(TrainingSet trainingSet)
Override this method to implement specific learning epoch - one learning iteration, one pass through whole training set

Parameters:
trainingSet - training set