The Encog Project

org.encog.neural.networks.training.propagation.gradient
Class GradientUtil

java.lang.Object
  extended by org.encog.neural.networks.training.propagation.gradient.GradientUtil

public class GradientUtil
extends java.lang.Object

Single threaded class that actually calculates the gradients. This is used by the individual gradient worker classes.


Constructor Summary
GradientUtil(BasicNetwork network)
          Construct the gradient utility.
 
Method Summary
 void calculate(NeuralData input, NeuralData ideal)
          Calculate the gradents between the input and ideal data.
 void calculate(NeuralDataSet training, double[] weights)
          Calculate for an entire training set.
 int getCount()
           
 double getError()
           
 double[] getErrors()
           
 void reset(double[] weights)
          Reset for an iteration.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GradientUtil

public GradientUtil(BasicNetwork network)
Construct the gradient utility.

Parameters:
network - The network to calculate gradients for.
Method Detail

calculate

public void calculate(NeuralData input,
                      NeuralData ideal)
Calculate the gradents between the input and ideal data.

Parameters:
input - The input data.
ideal - The desired output data.

calculate

public void calculate(NeuralDataSet training,
                      double[] weights)
Calculate for an entire training set.

Parameters:
training - The training set to use.
weights - The weights to use.

getCount

public int getCount()
Returns:
The training set count.

getError

public double getError()
Returns:
The currenht error

getErrors

public double[] getErrors()
Returns:
The gradients.

reset

public void reset(double[] weights)
Reset for an iteration.

Parameters:
weights - The weights.

The Encog Project