org.encog.neural.networks.training.propagation.scg
Class ScaledConjugateGradient
- java.lang.Object
-
- org.encog.ml.train.BasicTraining
-
- org.encog.neural.networks.training.propagation.Propagation
-
- org.encog.neural.networks.training.propagation.scg.ScaledConjugateGradient
-
- All Implemented Interfaces:
- MLTrain, BatchSize, GradientWorkerOwner, Train, MultiThreadable
public class ScaledConjugateGradient extends Propagation
This is a training class that makes use of scaled conjugate gradient methods. It is a very fast and efficient training algorithm.
-
-
Constructor Summary
Constructors Constructor and Description ScaledConjugateGradient(ContainsFlat network, MLDataSet training)Construct a training class.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcalculateGradients()Calculate the gradients.booleancanContinue()This training type does not support training continue.voidinitOthers()Unused.voiditeration()Perform one iteration.TrainingContinuationpause()This training type does not support training continue.voidresume(TrainingContinuation state)This training type does not support training continue.doubleupdateWeight(double[] gradients, double[] lastGradient, int index)Update the weights.doubleupdateWeight(double[] gradients, double[] lastGradient, int index, double dropoutRate)Update the weights.-
Methods inherited from class org.encog.neural.networks.training.propagation.Propagation
finishTraining, finishTraining, fixFlatSpot, getBatchSize, getCurrentFlatNetwork, getDropoutRate, getL1, getL2, getLastGradient, getMethod, getThreadCount, iteration, report, rollIteration, setBatchSize, setDroupoutRate, setErrorFunction, setL1, setL2, setThreadCount
-
Methods inherited from class org.encog.ml.train.BasicTraining
addStrategy, getError, getImplementationType, getIteration, getStrategies, getTraining, isTrainingDone, postIteration, preIteration, setError, setIteration, setTraining
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.encog.ml.train.MLTrain
addStrategy, getError, getImplementationType, getIteration, getStrategies, getTraining, isTrainingDone, setError, setIteration
-
-
-
-
Constructor Detail
-
ScaledConjugateGradient
public ScaledConjugateGradient(ContainsFlat network, MLDataSet training)
Construct a training class.- Parameters:
network- The network to train.training- The training data.
-
-
Method Detail
-
canContinue
public boolean canContinue()
This training type does not support training continue.- Returns:
- Always returns false.
-
pause
public TrainingContinuation pause()
This training type does not support training continue.- Returns:
- Always returns null.
-
resume
public void resume(TrainingContinuation state)
This training type does not support training continue.- Parameters:
state- Not used.
-
calculateGradients
public void calculateGradients()
Calculate the gradients. They are normalized as well.- Overrides:
calculateGradientsin classPropagation
-
iteration
public void iteration()
Perform one iteration.- Specified by:
iterationin interfaceMLTrain- Overrides:
iterationin classPropagation
-
updateWeight
public double updateWeight(double[] gradients, double[] lastGradient, int index)Update the weights.- Specified by:
updateWeightin classPropagation- Parameters:
gradients- The current gradients.lastGradient- The last gradients.index- The weight index being updated.- Returns:
- The new weight value.
-
updateWeight
public double updateWeight(double[] gradients, double[] lastGradient, int index, double dropoutRate)Update the weights.- Specified by:
updateWeightin classPropagation- Parameters:
gradients- The current gradients.lastGradient- The last gradients.index- The weight index being updated.dropoutRate- The dropout rate- Returns:
- The new weight value.
-
initOthers
public void initOthers()
Unused.- Specified by:
initOthersin classPropagation
-
-
DMelt 3.0 © DataMelt by jWork.ORG