org.encog.mathutil.matrices.hessian
Class HessianFD
- java.lang.Object
-
- org.encog.mathutil.matrices.hessian.BasicHessian
-
- org.encog.mathutil.matrices.hessian.HessianFD
-
- All Implemented Interfaces:
- ComputeHessian
public class HessianFD extends BasicHessian
Calculate the Hessian matrix using the finite difference method. This is a very simple method of calculating the Hessian. The algorithm does not vary greatly by number layers. This makes it very useful as a tool to check the accuracy of other methods of determining the Hessian. For more information on the Finite Difference Method see the following article. http://en.wikipedia.org/wiki/Finite_difference_method
-
-
Field Summary
Fields Modifier and Type Field and Description doubleINITIAL_STEPThe initial step size for dStep.
-
Constructor Summary
Constructors Constructor and Description HessianFD()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidcompute()Compute the Hessian.double[]createCoefficients()Compute finite difference coefficients according to the method provided here: http://en.wikipedia.org/wiki/Finite_difference_coefficientsintgetPointsPerSide()voidinit(BasicNetwork theNetwork, MLDataSet theTraining)Init the class.voidsetPointsPerSide(int pointsPerSide)This specifies the number of points per side, default is 5.-
Methods inherited from class org.encog.mathutil.matrices.hessian.BasicHessian
clear, getGradients, getHessian, getHessianMatrix, getSSE, updateHessian
-
-
-
-
Field Detail
-
INITIAL_STEP
public final double INITIAL_STEP
The initial step size for dStep.- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(BasicNetwork theNetwork, MLDataSet theTraining)
Init the class.- Specified by:
initin interfaceComputeHessian- Overrides:
initin classBasicHessian- Parameters:
theNetwork- The neural network to train.theTraining- The training set to train with.
-
compute
public void compute()
Compute the Hessian.
-
createCoefficients
public double[] createCoefficients()
Compute finite difference coefficients according to the method provided here: http://en.wikipedia.org/wiki/Finite_difference_coefficients- Returns:
- An array of the coefficients for FD.
-
getPointsPerSide
public int getPointsPerSide()
- Returns:
- The number of points per side.
-
setPointsPerSide
public void setPointsPerSide(int pointsPerSide)
This specifies the number of points per side, default is 5. Must be called before init.- Parameters:
pointsPerSide- The number of points per side.
-
-
DMelt 3.0 © DataMelt by jWork.ORG