The Encog Project

org.encog.neural.networks.training.anneal
Class NeuralSimulatedAnnealing

java.lang.Object
  extended by org.encog.solve.anneal.SimulatedAnnealing<java.lang.Double>
      extended by org.encog.neural.networks.training.anneal.NeuralSimulatedAnnealing

public class NeuralSimulatedAnnealing
extends SimulatedAnnealing<java.lang.Double>

NeuralSimulatedAnnealing: This class implements a simulated annealing training algorithm for feed forward neural networks. It is based on the generic SimulatedAnnealing class. It is used in the same manner as any other training class that implements the Train interface.


Field Summary
static double CUT
          The cutoff for random data.
 
Constructor Summary
NeuralSimulatedAnnealing(BasicNetwork network, NeuralDataSet training, double startTemp, double stopTemp, int cycles)
          Construct a simulated annleaing trainer for a feedforward neural network.
 
Method Summary
 double determineError()
          Determine the error of the current weights and thresholds.
 java.lang.Double[] getArray()
          Get the network as an array of doubles.
 java.lang.Double[] getArrayCopy()
          Get a copy of the array.
 BasicNetwork getNetwork()
          Get the best network from the training.
 void putArray(java.lang.Double[] array)
          Convert an array of doubles to the current best network.
 void randomize()
          Randomize the weights and thresholds.
 
Methods inherited from class org.encog.solve.anneal.SimulatedAnnealing
getCycles, getError, getStartTemperature, getStopTemperature, getTemperature, iteration, setCycles, setError, setStartTemperature, setStopTemperature, setTemperature
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

CUT

public static final double CUT
The cutoff for random data.

See Also:
Constant Field Values
Constructor Detail

NeuralSimulatedAnnealing

public NeuralSimulatedAnnealing(BasicNetwork network,
                                NeuralDataSet training,
                                double startTemp,
                                double stopTemp,
                                int cycles)
Construct a simulated annleaing trainer for a feedforward neural network.

Parameters:
network - The neural network to be trained.
training - The training set.
startTemp - The starting temperature.
stopTemp - The ending temperature.
cycles - The number of cycles in a training iteration.
Method Detail

determineError

public double determineError()
Determine the error of the current weights and thresholds.

Specified by:
determineError in class SimulatedAnnealing<java.lang.Double>
Returns:
The error.

getArray

public java.lang.Double[] getArray()
Get the network as an array of doubles.

Specified by:
getArray in class SimulatedAnnealing<java.lang.Double>
Returns:
The network as an array of doubles.

getArrayCopy

public java.lang.Double[] getArrayCopy()
Description copied from class: SimulatedAnnealing
Get a copy of the array.

Specified by:
getArrayCopy in class SimulatedAnnealing<java.lang.Double>
Returns:
A copy of the annealing array.

getNetwork

public BasicNetwork getNetwork()
Get the best network from the training.

Returns:
The best network.

putArray

public void putArray(java.lang.Double[] array)
Convert an array of doubles to the current best network.

Specified by:
putArray in class SimulatedAnnealing<java.lang.Double>
Parameters:
array - An array.

randomize

public void randomize()
Randomize the weights and thresholds. This function does most of the work of the class. Each call to this class will randomize the data according to the current temperature. The higher the temperature the more randomness.

Specified by:
randomize in class SimulatedAnnealing<java.lang.Double>

The Encog Project