org.neuroph.nnet.learning
Class SimulatedAnnealingLearning
- java.lang.Object
-
- org.neuroph.core.learning.LearningRule
-
- org.neuroph.core.learning.IterativeLearning
-
- org.neuroph.core.learning.SupervisedLearning
-
- org.neuroph.nnet.learning.SimulatedAnnealingLearning
-
- All Implemented Interfaces:
- java.io.Serializable
public class SimulatedAnnealingLearning extends SupervisedLearning
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.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description SimulatedAnnealingLearning(NeuralNetwork network)SimulatedAnnealingLearning(NeuralNetwork network, double startTemp, double stopTemp, int cycles)Construct a simulated annleaing trainer for a feedforward neural network.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voiddoLearningEpoch(DataSet trainingSet)Perform one simulated annealing epoch.voiddoLearningEpoch(DataSet trainingSet, double randomChance)NeuralNetworkgetNetwork()Get the best network from the training.voidrandomize(double randomChance)Randomize the weights and thresholds.-
Methods inherited from class org.neuroph.core.learning.SupervisedLearning
getErrorFunction, getMaxError, getMinErrorChange, getMinErrorChangeIterationsCount, getMinErrorChangeIterationsLimit, getPreviousEpochError, getTotalNetworkError, isBatchMode, learn, learn, setBatchMode, setErrorFunction, setMaxError, setMinErrorChange, setMinErrorChangeIterationsLimit
-
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
-
SimulatedAnnealingLearning
public SimulatedAnnealingLearning(NeuralNetwork network, double startTemp, double stopTemp, int cycles)
Construct a simulated annleaing trainer for a feedforward neural network.- Parameters:
network- The neural network to be trained.startTemp- The starting temperature.stopTemp- The ending temperature.cycles- The number of cycles in a training iteration.
-
SimulatedAnnealingLearning
public SimulatedAnnealingLearning(NeuralNetwork network)
-
-
Method Detail
-
getNetwork
public NeuralNetwork getNetwork()
Get the best network from the training.- Returns:
- The best network.
-
randomize
public void randomize(double randomChance)
Randomize the weights and thresholds. This function does most of the work of the class. Each call to this class will randomize the data according to the current temperature. The higher the temperature the more randomness.- Parameters:
randomChance-
-
doLearningEpoch
public void doLearningEpoch(DataSet trainingSet)
Perform one simulated annealing epoch.- Overrides:
doLearningEpochin classSupervisedLearning- Parameters:
trainingSet- training set for training network
-
doLearningEpoch
public void doLearningEpoch(DataSet trainingSet, double randomChance)
-
-
DMelt 3.0 © DataMelt by jWork.ORG