org.neuroph.core.learning
Class SupervisedLearning
- java.lang.Object
-
- org.neuroph.core.learning.LearningRule
-
- org.neuroph.core.learning.IterativeLearning
-
- org.neuroph.core.learning.SupervisedLearning
-
- All Implemented Interfaces:
- java.io.Serializable
- Direct Known Subclasses:
- LMS, SimulatedAnnealingLearning
public abstract class SupervisedLearning extends IterativeLearning implements java.io.Serializable
Base class for all supervised learning algorithms. It extends IterativeLearning, and provides general supervised learning principles. Based on Template Method Pattern with abstract method calculateWeightChanges TODO: random pattern order- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SupervisedLearning()Creates new supervised learning rule
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddoLearningEpoch(DataSet trainingSet)This method implements basic logic for one learning epoch for the supervised learning algorithms.ErrorFunctiongetErrorFunction()doublegetMaxError()Returns learning error tolerance - the value of total network error to stop learning.doublegetMinErrorChange()Returns min error change stopping criteriaintgetMinErrorChangeIterationsCount()Returns number of iterations count for for min error change stopping criteriaintgetMinErrorChangeIterationsLimit()Returns number of iterations for min error change stopping criteriadoublegetPreviousEpochError()Returns total network error in previous learning epochdoublegetTotalNetworkError()booleanisBatchMode()Returns true if learning is performed in batch mode, false otherwisevoidlearn(DataSet trainingSet, double maxError)Trains network for the specified training set and maxErrorvoidlearn(DataSet trainingSet, double maxError, int maxIterations)Trains network for the specified training set, maxError and number of iterationsvoidsetBatchMode(boolean batchMode)Sets batch mode on/off (true/false)voidsetErrorFunction(ErrorFunction errorFunction)voidsetMaxError(double maxError)Sets allowed network error, which indicates when to stopLearning trainingvoidsetMinErrorChange(double minErrorChange)Sets min error change stopping criteriavoidsetMinErrorChangeIterationsLimit(int minErrorChangeIterationsLimit)Sets number of iterations for min error change stopping criteria-
Methods inherited from class org.neuroph.core.learning.IterativeLearning
doOneLearningIteration, getCurrentIteration, getLearningRate, getMaxIterations, isIterationsLimited, isPausedLearning, learn, learn, pause, resume, setLearningRate, setMaxIterations
-
Methods inherited from class org.neuroph.core.learning.LearningRule
addListener, getNeuralNetwork, getTrainingSet, isStopped, removeListener, setNeuralNetwork, setTrainingSet, stopLearning
-
-
-
-
Constructor Detail
-
SupervisedLearning
public SupervisedLearning()
Creates new supervised learning rule
-
-
Method Detail
-
learn
public final void learn(DataSet trainingSet, double maxError)
Trains network for the specified training set and maxError- Parameters:
trainingSet- training set to learnmaxError- learning stop condition. If maxError is reached learning stops
-
learn
public final void learn(DataSet trainingSet, double maxError, int maxIterations)
Trains network for the specified training set, maxError and number of iterations- Parameters:
trainingSet- training set to learnmaxError- learning stop condition. if maxError is reached learning stopsmaxIterations- maximum number of learning iterations
-
doLearningEpoch
public void doLearningEpoch(DataSet trainingSet)
This method implements basic logic for one learning epoch for the supervised learning algorithms. Epoch is the one pass through the training set. This method iterates through the training set and trains network for each element. It also sets flag if conditions to stop learning has been reached: network error below some allowed value, or maximum iteration count- Specified by:
doLearningEpochin classIterativeLearning- Parameters:
trainingSet- training set for training network
-
isBatchMode
public boolean isBatchMode()
Returns true if learning is performed in batch mode, false otherwise- Returns:
- true if learning is performed in batch mode, false otherwise
-
setBatchMode
public void setBatchMode(boolean batchMode)
Sets batch mode on/off (true/false)- Parameters:
batchMode- batch mode setting
-
setMaxError
public void setMaxError(double maxError)
Sets allowed network error, which indicates when to stopLearning training- Parameters:
maxError- network error
-
getMaxError
public double getMaxError()
Returns learning error tolerance - the value of total network error to stop learning.- Returns:
- learning error tolerance
-
getPreviousEpochError
public double getPreviousEpochError()
Returns total network error in previous learning epoch- Returns:
- total network error in previous learning epoch
-
getMinErrorChange
public double getMinErrorChange()
Returns min error change stopping criteria- Returns:
- min error change stopping criteria
-
setMinErrorChange
public void setMinErrorChange(double minErrorChange)
Sets min error change stopping criteria- Parameters:
minErrorChange- value for min error change stopping criteria
-
getMinErrorChangeIterationsLimit
public int getMinErrorChangeIterationsLimit()
Returns number of iterations for min error change stopping criteria- Returns:
- number of iterations for min error change stopping criteria
-
setMinErrorChangeIterationsLimit
public void setMinErrorChangeIterationsLimit(int minErrorChangeIterationsLimit)
Sets number of iterations for min error change stopping criteria- Parameters:
minErrorChangeIterationsLimit- number of iterations for min error change stopping criteria
-
getMinErrorChangeIterationsCount
public int getMinErrorChangeIterationsCount()
Returns number of iterations count for for min error change stopping criteria- Returns:
- number of iterations count for for min error change stopping criteria
-
getErrorFunction
public ErrorFunction getErrorFunction()
-
setErrorFunction
public void setErrorFunction(ErrorFunction errorFunction)
-
getTotalNetworkError
public double getTotalNetworkError()
-
-
DMelt 3.0 © DataMelt by jWork.ORG