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.ml.train
Class BasicTraining

    java.lang.Object
      org.encog.ml.train.BasicTraining

All Implemented Interfaces:
  MLTrain

Direct Known Subclasses:
  BasicTrainSOM, CrossTraining, LevenbergMarquardtTraining, NeuralGeneticAlgorithm, NeuralSimulatedAnnealing, Propagation, SOMClusterCopyTraining, SVDTraining, SVMSearchTrain, SVMTrain, TrainAdaline, TrainBasicPNN, TrainInstar, TrainOutstar

    public abstract class BasicTraining

extends Object
implements MLTrain

An abstract class that implements basic training for most training algorithms. Specifically training strategies can be added to enhance the training.

Author:
  jheaton

Constructor Summary
`BasicTraining(TrainingImplementationType implementationType)`

Method Summary
`void` | `addStrategy(Strategy strategy)` Training strategies can be added to improve the training results.
`void` | `finishTraining()` Should be called after training has completed and the iteration method will not be called any further.
`double` | `getError()` Get the current error percent from the training.
`TrainingImplementationType` | `getImplementationType()`
`int` | `getIteration()`
`List<Strategy>` | `getStrategies()`
`MLDataSet` | `getTraining()`
`boolean` | `isTrainingDone()`
`void` | `iteration(int count)` Perform the specified number of training iterations.
`void` | `postIteration()` Call the strategies after an iteration.
`void` | `preIteration()` Call the strategies before an iteration.
`void` | `setError(double error)`
`void` | `setIteration(int iteration)` Set the current training iteration.
`void` | `setTraining(MLDataSet training)` Set the training object that this strategy is working with.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods inherited from interface org.encog.ml.train.MLTrain
`canContinue, getMethod, iteration, pause, resume`

Constructor Detail

### BasicTraining

    public BasicTraining(TrainingImplementationType implementationType)

Method Detail

### addStrategy

    public void addStrategy(Strategy strategy)

  Training strategies can be added to improve the training results. There are a number to choose from, and several can be used at once.

  Specified by:
    `addStrategy` in interface `MLTrain`
  Parameters:
    `strategy` - The strategy to add.

### finishTraining

    public void finishTraining()

  Should be called after training has completed and the iteration method will not be called any further.

  Specified by:
    `finishTraining` in interface `MLTrain`

### getError

    public double getError()

  Get the current error percent from the training.

  Specified by:
    `getError` in interface `MLTrain`
  Returns:
    The current error.

### getIteration

    public int getIteration()

  Specified by:
    `getIteration` in interface `MLTrain`
  Returns:
    the iteration

### getStrategies

    public List<Strategy> getStrategies()

  Specified by:
    `getStrategies` in interface `MLTrain`
  Returns:
    The strategies to use.

### getTraining

    public MLDataSet getTraining()

  Specified by:
    `getTraining` in interface `MLTrain`
  Returns:
    The training data to use.

### isTrainingDone

    public boolean isTrainingDone()

  Specified by:
    `isTrainingDone` in interface `MLTrain`
  Returns:
    True if training can progress no further.

### iteration

    public void iteration(int count)

  Perform the specified number of training iterations. This is a basic implementation that just calls iteration the specified number of times. However, some training methods, particularly with the GPU, benefit greatly by calling with higher numbers than 1.

  Specified by:
    `iteration` in interface `MLTrain`
  Parameters:
    `count` - The number of training iterations.

### postIteration

    public void postIteration()

  Call the strategies after an iteration.

### preIteration

    public void preIteration()

  Call the strategies before an iteration.

### setError

    public void setError(double error)

  Specified by:
    `setError` in interface `MLTrain`
  Parameters:
    `error` - Set the current error rate. This is usually used by training strategies.

### setIteration

    public void setIteration(int iteration)

  Description copied from interface: `MLTrain`
  Set the current training iteration.

  Specified by:
    `setIteration` in interface `MLTrain`
  Parameters:
    `iteration` - the iteration to set

### setTraining

    public void setTraining(MLDataSet training)

  Set the training object that this strategy is working with.

  Parameters:
    `training` - The training object.

### getImplementationType

    public TrainingImplementationType getImplementationType()

  Specified by:
    `getImplementationType` in interface `MLTrain`
  Returns:
    The training implementation type.

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 © 2011. All Rights Reserved.