org.encog.neural.flat.train.prop
Class TrainFlatNetworkSCG

java.lang.Object
  extended by org.encog.neural.flat.train.prop.TrainFlatNetworkProp
      extended by org.encog.neural.flat.train.prop.TrainFlatNetworkSCG
All Implemented Interfaces:
TrainFlatNetwork

public class TrainFlatNetworkSCG
extends TrainFlatNetworkProp

Train a network using scaled conjugate gradient.


Field Summary
protected static double FIRST_LAMBDA
          The starting value for lambda.
protected static double FIRST_SIGMA
          The starting value for sigma.
 
Fields inherited from class org.encog.neural.flat.train.prop.TrainFlatNetworkProp
currentError, gradients, lastError, network
 
Constructor Summary
TrainFlatNetworkSCG(FlatNetwork network, MLDataSet training)
          Construct the training object.
 
Method Summary
 void calculateGradients()
          Calculate the gradients.
 void initOthers()
          Perform training method specific init.
 void iteration()
          Perform one iteration.
 double updateWeight(double[] gradients, double[] lastGradient, int index)
          Update the weights.
 
Methods inherited from class org.encog.neural.flat.train.prop.TrainFlatNetworkProp
finishTraining, fixFlatSpot, getError, getErrorFunction, getIteration, getLastGradient, getNetwork, getNumThreads, getTraining, iteration, learn, learnLimited, report, setErrorFunction, setIteration, setNumThreads
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

FIRST_SIGMA

protected static final double FIRST_SIGMA
The starting value for sigma.

See Also:
Constant Field Values

FIRST_LAMBDA

protected static final double FIRST_LAMBDA
The starting value for lambda.

See Also:
Constant Field Values
Constructor Detail

TrainFlatNetworkSCG

public TrainFlatNetworkSCG(FlatNetwork network,
                           MLDataSet training)
Construct the training object.

Parameters:
network - The network to train.
training - The training data to use.
Method Detail

calculateGradients

public void calculateGradients()
Calculate the gradients. They are normalized as well.

Overrides:
calculateGradients in class TrainFlatNetworkProp

iteration

public void iteration()
Perform one iteration.

Specified by:
iteration in interface TrainFlatNetwork
Overrides:
iteration in class TrainFlatNetworkProp

updateWeight

public double updateWeight(double[] gradients,
                           double[] lastGradient,
                           int index)
Update the weights.

Specified by:
updateWeight in class TrainFlatNetworkProp
Parameters:
gradients - The current gradients.
lastGradient - The last gradients.
index - The weight index being updated.
Returns:
The new weight value.

initOthers

public void initOthers()
Perform training method specific init.

Specified by:
initOthers in class TrainFlatNetworkProp


Copyright © 2011. All Rights Reserved.