public abstract class IterativeLearning extends LearningRule implements Serializable
Modifier and Type | Field and Description |
---|---|
protected int |
currentIteration
Current iteration counter
|
protected double |
learningRate
Learning rate parametar
|
protected List<StopCondition> |
stopConditions |
listeners, neuralNetwork, trainingSet
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 with the specified training set and fires
event to notify observers.
|
int |
getCurrentIteration()
Returns current iteration of this learning algorithm
|
double |
getLearningRate()
Returns learning rate for this algorithm
|
int |
getMaxIterations()
Returns max iterations limit of this learning algorithm
|
protected boolean |
hasReachedStopCondition()
Returns true if any of the stop conditions has been reached.
|
boolean |
isIterationsLimited() |
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, onStop, removeListener, setNeuralNetwork, setTrainingSet, stopLearning
protected double learningRate
protected int currentIteration
protected List<StopCondition> stopConditions
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 int getMaxIterations()
public boolean isIterationsLimited()
public int getCurrentIteration()
public boolean isPausedLearning()
public final void pause()
public final void resume()
protected void onStart()
onStart
in class LearningRule
protected void beforeEpoch()
protected void afterEpoch()
public final void learn(DataSet trainingSet)
LearningRule
learn
in class LearningRule
trainingSet
- training setprotected final boolean hasReachedStopCondition()
public 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 © 2019 Neuroph Project. All rights reserved.