org.encog.mathutil.matrices.hessian
Class ChainRuleWorker
- java.lang.Object
-
- org.encog.mathutil.matrices.hessian.ChainRuleWorker
-
- All Implemented Interfaces:
- EngineTask
public class ChainRuleWorker extends java.lang.Object implements EngineTask
A threaded worker that is used to calculate the first derivatives of the output of the neural network. These values are ultimatly used to calculate the Hessian.
-
-
Constructor Summary
Constructors Constructor and Description ChainRuleWorker(FlatNetwork theNetwork, MLDataSet theTraining, int theLow, int theHigh)Construct the chain rule worker.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description double[]getDerivative()doublegetError()double[]getGradients()double[][]getHessian()FlatNetworkgetNetwork()intgetOutputNeuron()voidrun()The task to perform.voidsetOutputNeuron(int outputNeuron)
-
-
-
Constructor Detail
-
ChainRuleWorker
public ChainRuleWorker(FlatNetwork theNetwork, MLDataSet theTraining, int theLow, int theHigh)
Construct the chain rule worker.- Parameters:
theNetwork- The network to calculate a Hessian for.theTraining- The training data.theLow- The low range.theHigh- The high range.
-
-
Method Detail
-
run
public void run()
The task to perform.- Specified by:
runin interfaceEngineTask
-
getOutputNeuron
public int getOutputNeuron()
- Returns:
- the outputNeuron
-
setOutputNeuron
public void setOutputNeuron(int outputNeuron)
- Parameters:
outputNeuron- the outputNeuron to set
-
getDerivative
public double[] getDerivative()
- Returns:
- The first derivatives, used to calculate the Hessian.
-
getGradients
public double[] getGradients()
- Returns:
- the gradients
-
getError
public double getError()
- Returns:
- The SSE error.
-
getNetwork
public FlatNetwork getNetwork()
- Returns:
- The flat network.
-
getHessian
public double[][] getHessian()
- Returns:
- the hessian
-
-
DMelt 3.0 © DataMelt by jWork.ORG