org.encog.mathutil.matrices.hessian

## Class ChainRuleWorker

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

- All Implemented Interfaces:
    EngineTask

      public class ChainRuleWorker
      extends 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

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double[]` | `getDerivative()`
    `double` | `getError()`
    `double[]` | `getGradients()`
    `double[][]` | `getHessian()`
    `FlatNetwork` | `getNetwork()`
    `int` | `getOutputNeuron()`
    `void` | `run()` The task to perform.
    `void` | `setOutputNeuron(int outputNeuron)`

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

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

- - ### 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:
        `run` in interface `EngineTask`

    - #### 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

Copyright © 2014. All Rights Reserved.