org.encog.mathutil.matrices.hessian

## Class BasicHessian

- java.lang.Object
- - org.encog.mathutil.matrices.hessian.BasicHessian

- All Implemented Interfaces:
    ComputeHessian
  Direct Known Subclasses:
    HessianCR, HessianFD

      public abstract class BasicHessian
      extends Object
      implements ComputeHessian

  Some basic code used to calculate Hessian matrixes.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected FlatNetwork` | `flat` The flat network.
    `protected double[]` | `gradients` The gradients of the Hessian.
    `protected double[][]` | `hessian` The Hessian 2d array.
    `protected Matrix` | `hessianMatrix` The Hessian matrix.
    `protected BasicNetwork` | `network` The neural network that we would like to train.
    `protected double` | `sse` The sum of square error.
    `protected MLDataSet` | `training` The training data that provides the ideal values.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicHessian()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `clear()` Clear the Hessian and gradients.
    `double[]` | `getGradients()` The gradeints.
    `double[][]` | `getHessian()`
    `Matrix` | `getHessianMatrix()`
    `double` | `getSSE()`
    `void` | `init(BasicNetwork theNetwork, MLDataSet theTraining)` Init the class.
    `void` | `updateHessian(double[] d)` Update the Hessian, sum's with what is in the Hessian already.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

    - ### Methods inherited from interface org.encog.mathutil.matrices.hessian.ComputeHessian

      `compute`

- - ### Field Detail

    - #### training

          protected MLDataSet training

      The training data that provides the ideal values.

    - #### network

          protected BasicNetwork network

      The neural network that we would like to train.

    - #### sse

          protected double sse

      The sum of square error.

    - #### gradients

          protected double[] gradients

      The gradients of the Hessian.

    - #### hessianMatrix

          protected Matrix hessianMatrix

      The Hessian matrix.

    - #### hessian

          protected double[][] hessian

      The Hessian 2d array.

    - #### flat

          protected FlatNetwork flat

      The flat network.

  - ### Constructor Detail

    - #### BasicHessian

          public BasicHessian()

  - ### Method Detail

    - #### init

          public void init(BasicNetwork theNetwork,
                  MLDataSet theTraining)

      Init the class.
      Specified by:
        `init` in interface `ComputeHessian`
      Parameters:
        `theNetwork` - The neural network to train.
        `theTraining` - The training set to train with.

    - #### getGradients

          public double[] getGradients()

      The gradeints.
      Specified by:
        `getGradients` in interface `ComputeHessian`
      Returns:
        The gradients for the Hessian.

    - #### getHessianMatrix

          public Matrix getHessianMatrix()

      Specified by:
        `getHessianMatrix` in interface `ComputeHessian`
      Returns:
        The Hessian matrix.

    - #### getHessian

          public double[][] getHessian()

      Specified by:
        `getHessian` in interface `ComputeHessian`
      Returns:
        Get the Hessian as a 2d array.

    - #### clear

          public void clear()

      Clear the Hessian and gradients.
      Specified by:
        `clear` in interface `ComputeHessian`

    - #### getSSE

          public double getSSE()

      Specified by:
        `getSSE` in interface `ComputeHessian`
      Returns:
        The sum of squares error over all of the training elements.

    - #### updateHessian

          public void updateHessian(double[] d)

      Update the Hessian, sum's with what is in the Hessian already. Call clear to clear out old Hessian.
      Parameters:
        `d` -

Copyright © 2014. All Rights Reserved.