org.encog.neural.networks.training.propagation
Class GradientWorker
- java.lang.Object
-
- org.encog.neural.networks.training.propagation.GradientWorker
-
- All Implemented Interfaces:
- EngineTask
public class GradientWorker extends java.lang.Object implements EngineTask
Worker class for the mulithreaded training of flat networks.
-
-
Constructor Summary
Constructors Constructor and Description GradientWorker(FlatNetwork theNetwork, GradientWorkerOwner theOwner, MLDataSet theTraining, int theLow, int theHigh, double[] flatSpot, ErrorFunction ef)Construct a gradient worker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcalculateRegularizationPenalty(double[] l)ErrorCalculationgetErrorCalculation()double[]getGradients()FlatNetworkgetNetwork()double[]getWeights()voidlayerRegularizationPenalty(int fromLayer, double[] l)voidprocess(MLDataPair pair)Process one training set element.voidrun()Perform the gradient calculation for the specified index range.voidrun(int index)
-
-
-
Constructor Detail
-
GradientWorker
public GradientWorker(FlatNetwork theNetwork, GradientWorkerOwner theOwner, MLDataSet theTraining, int theLow, int theHigh, double[] flatSpot, ErrorFunction ef)
Construct a gradient worker.- Parameters:
theNetwork- The network to train.theOwner- The owner that is doing the training.theTraining- The training data.theLow- The low index to use in the training data.theHigh- The high index to use in the training data.flatSpot- The flatspot additions for each layeref- Error function
-
-
Method Detail
-
getNetwork
public FlatNetwork getNetwork()
- Returns:
- The network being processed.
-
getWeights
public double[] getWeights()
- Returns:
- The weights for this network.
-
process
public void process(MLDataPair pair)
Process one training set element.- Parameters:
pair- the training data information
-
run
public final void run()
Perform the gradient calculation for the specified index range.- Specified by:
runin interfaceEngineTask
-
run
public final void run(int index)
-
getErrorCalculation
public ErrorCalculation getErrorCalculation()
-
getGradients
public double[] getGradients()
- Returns:
- the gradients
-
calculateRegularizationPenalty
public void calculateRegularizationPenalty(double[] l)
-
layerRegularizationPenalty
public void layerRegularizationPenalty(int fromLayer, double[] l)
-
-
DMelt 3.0 © DataMelt by jWork.ORG