Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

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

    java.lang.Object
      org.encog.ml.train.BasicTraining
          org.encog.neural.networks.training.anneal.NeuralSimulatedAnnealing

All Implemented Interfaces:
  MLTrain

    public class NeuralSimulatedAnnealing

extends BasicTraining

This class implements a simulated annealing training algorithm for 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. There are essentially two ways you can make use of this class. Either way, you will need a score object. The score object tells the simulated annealing algorithm how well suited a neural network is. If you would like to use simulated annealing with a training set you should make use TrainingSetScore class. This score object uses a training set to score your neural network. If you would like to be more abstract, and not use a training set, you can create your own implementation of the CalculateScore method. This class can then score the networks any way that you like.

Field Summary
`static double` | `CUT` The cutoff for random data.

Constructor Summary
`NeuralSimulatedAnnealing(BasicNetwork network, CalculateScore calculateScore, double startTemp, double stopTemp, int cycles)` Construct a simulated annleaing trainer for a feedforward neural network.

Method Summary
`boolean` | `canContinue()`
`double[]` | `getArray()` Get the network as an array of doubles.
`double[]` | `getArrayCopy()`
`CalculateScore` | `getCalculateScore()`
`BasicNetwork` | `getMethod()` Get the current best machine learning method from the training.
`void` | `iteration()` Perform one iteration of simulated annealing.
`TrainingContinuation` | `pause()` Pause the training to continue later.
`void` | `putArray(double[] array)` Convert an array of doubles to the current best network.
`void` | `randomize()` Randomize the weights and bias values.
`void` | `resume(TrainingContinuation state)` Resume training.

Methods inherited from class org.encog.ml.train.BasicTraining
`addStrategy, finishTraining, getError, getImplementationType, getIteration, getStrategies, getTraining, isTrainingDone, iteration, postIteration, preIteration, setError, setIteration, setTraining`

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,
                                    CalculateScore calculateScore,
                                    double startTemp,
                                    double stopTemp,
                                    int cycles)

  Construct a simulated annleaing trainer for a feedforward neural network.

  Parameters:
    `network` - The neural network to be trained.
    `calculateScore` - Used to calculate the score for a neural network.
    `startTemp` - The starting temperature.
    `stopTemp` - The ending temperature.
    `cycles` - The number of cycles in a training iteration.

Method Detail

### canContinue

    public final boolean canContinue()

  Returns:
    True if the training can be paused, and later continued.

### getArray

    public final double[] getArray()

  Get the network as an array of doubles.

  Returns:
    The network as an array of doubles.

### getArrayCopy

    public final double[] getArrayCopy()

  Returns:
    A copy of the annealing array.

### getCalculateScore

    public final CalculateScore getCalculateScore()

  Returns:
    The object used to calculate the score.

### getMethod

    public final BasicNetwork getMethod()

  Get the current best machine learning method from the training.

  Returns:
    The best machine learningm method.

### iteration

    public final void iteration()

  Perform one iteration of simulated annealing.

### pause

    public TrainingContinuation pause()

  Description copied from interface: `MLTrain`
  Pause the training to continue later.

  Returns:
    A training continuation object.

### putArray

    public final void putArray(double[] array)

  Convert an array of doubles to the current best network.

  Parameters:
    `array` - An array.

### randomize

    public final void randomize()

  Randomize the weights and bias values. 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.

### resume

    public void resume(TrainingContinuation state)

  Resume training.

  Parameters:
    `state` - The training continuation object to use to continue.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2012. All Rights Reserved.