public abstract class IterativeLearning extends LearningRule implements Serializable
| Modifier and Type | Field and Description |
|---|---|
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)
TODO: this field should be private, to force use of setMaxIterations from derived classes, so
iterationsLimited flag is also set at the sam etime.Wil that break backward compatibility with serialized networks?
|
listeners, neuralNetwork| Constructor and Description |
|---|
IterativeLearning()
Creates new instance of IterativeLearning learning algorithm
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
afterEpoch() |
protected void |
beforeEpoch() |
abstract void |
doLearningEpoch(DataSet trainingSet)
Override this method to implement specific learning epoch - one learning iteration, one pass through whole training set
|
void |
doOneLearningIteration(DataSet trainingSet)
Runs one learning iteration for the specified training set and notfies observers.
|
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(DataSet trainingSet)
Override this method to implement specific learning procedures
|
void |
learn(DataSet trainingSet,
int maxIterations)
Trains network for the specified training set and number of iterations
|
protected void |
onStart()
This method is executed when learning starts, before the first epoch.
|
void |
pause()
Pause the learning
|
void |
resume()
Resumes the paused learning
|
void |
setLearningRate(double learningRate)
Sets learning rate for this algorithm
|
void |
setMaxIterations(int maxIterations)
Sets iteration limit for this learning algorithm
|
addListener, fireLearningEvent, getNeuralNetwork, getTrainingSet, isStopped, removeListener, setNeuralNetwork, setTrainingSet, stopLearningprotected double learningRate
protected int currentIteration
protected int maxIterations
protected boolean iterationsLimited
public IterativeLearning()
public double getLearningRate()
public void setLearningRate(double learningRate)
learningRate - learning rate for this algorithmpublic void setMaxIterations(int maxIterations)
maxIterations - iteration limit for this learning algorithmpublic Integer getCurrentIteration()
public boolean isPausedLearning()
public void pause()
public void resume()
protected void onStart()
onStart in class LearningRuleprotected void beforeEpoch()
protected void afterEpoch()
public final void learn(DataSet trainingSet)
LearningRulelearn in class LearningRuletrainingSet - training setpublic void learn(DataSet trainingSet, int maxIterations)
trainingSet - training set to learnmaxIterations - maximum numberof iterations to learnpublic void doOneLearningIteration(DataSet trainingSet)
trainingSet - training set to learnpublic abstract void doLearningEpoch(DataSet trainingSet)
trainingSet - training setCopyright © 2013. All Rights Reserved.