|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.neuroph.core.learning.LearningRule
org.neuroph.core.learning.IterativeLearning
org.neuroph.core.learning.SupervisedLearning
org.neuroph.nnet.learning.SimulatedAnnealingLearning
public class SimulatedAnnealingLearning
This class implements a simulated annealing learning rule for supervised neural networks. It is based on the generic SimulatedAnnealing class. It is used in the same manner as any other training class that implements the SupervisedLearning interface. Simulated annealing is a common training method. It is often used in conjunction with a propagation training method. Simulated annealing can be very good when propagation training has reached a local minimum. The name and inspiration come from annealing in metallurgy, a technique involving heating and controlled cooling of a material to increase the size of its crystals and reduce their defects. The heat causes the atoms to become unstuck from their initial positions (a local minimum of the internal energy) and wander randomly through states of higher energy; the slow cooling gives them more chances of finding configurations with lower internal energy than the initial one.
Field Summary | |
---|---|
protected NeuralNetwork |
network
The neural network that is to be trained. |
protected double |
temperature
The current temperature. |
Fields inherited from class org.neuroph.core.learning.SupervisedLearning |
---|
maxError, outputError, previousEpochError, totalNetworkError, totalSquaredErrorSum |
Fields inherited from class org.neuroph.core.learning.IterativeLearning |
---|
currentIteration, iterationsLimited, learningRate, maxIterations |
Fields inherited from class org.neuroph.core.learning.LearningRule |
---|
listeners, neuralNetwork |
Constructor Summary | |
---|---|
SimulatedAnnealingLearning(NeuralNetwork network)
|
|
SimulatedAnnealingLearning(NeuralNetwork network,
double startTemp,
double stopTemp,
int cycles)
Construct a simulated annleaing trainer for a feedforward neural network. |
Method Summary | |
---|---|
protected void |
addToSquaredErrorSum(double[] patternError)
Calculates and updates sum of squared errors for single pattern, and updates total sum of squared pattern errors |
void |
doLearningEpoch(DataSet trainingSet)
Perform one simulated annealing epoch. |
NeuralNetwork |
getNetwork()
Get the best network from the training. |
void |
randomize()
Randomize the weights and thresholds. |
protected void |
updateNetworkWeights(double[] patternError)
Not used. |
protected void |
updateTotalNetworkError(double[] patternError)
Update the total error. |
Methods inherited from class org.neuroph.core.learning.SupervisedLearning |
---|
afterEpoch, beforeEpoch, calculateOutputError, doBatchWeightsUpdate, errorChangeStalled, getMaxError, getMinErrorChange, getMinErrorChangeIterationsCount, getMinErrorChangeIterationsLimit, getPreviousEpochError, getTotalNetworkError, hasReachedStopCondition, isInBatchMode, learn, learn, learnPattern, onStart, setBatchMode, setMaxError, setMinErrorChange, setMinErrorChangeIterationsLimit |
Methods inherited from class org.neuroph.core.learning.IterativeLearning |
---|
doOneLearningIteration, getCurrentIteration, getLearningRate, isPausedLearning, learn, learn, pause, resume, setLearningRate, setMaxIterations |
Methods inherited from class org.neuroph.core.learning.LearningRule |
---|
addListener, fireLearningEvent, getNeuralNetwork, getTrainingSet, isStopped, removeListener, setNeuralNetwork, setTrainingSet, stopLearning |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected NeuralNetwork network
protected double temperature
Constructor Detail |
---|
public SimulatedAnnealingLearning(NeuralNetwork network, double startTemp, double stopTemp, int cycles)
network
- The neural network to be trained.startTemp
- The starting temperature.stopTemp
- The ending temperature.cycles
- The number of cycles in a training iteration.public SimulatedAnnealingLearning(NeuralNetwork network)
Method Detail |
---|
protected void addToSquaredErrorSum(double[] patternError)
SupervisedLearning
addToSquaredErrorSum
in class SupervisedLearning
patternError
- output error vectorpublic NeuralNetwork getNetwork()
public void randomize()
public void doLearningEpoch(DataSet trainingSet)
doLearningEpoch
in class SupervisedLearning
trainingSet
- training set for training networkprotected void updateTotalNetworkError(double[] patternError)
protected void updateNetworkWeights(double[] patternError)
updateNetworkWeights
in class SupervisedLearning
patternError
- output error vector for some network input (aka. patternError, network error)
usually the difference between desired and actual outputcalculateOutputError
,
SupervisedLearning.addToSquaredErrorSum(double[])
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |