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.ea.train.basic
Class TrainEA

    java.lang.Object
      org.encog.ml.ea.train.basic.BasicEA
          org.encog.ml.ea.train.basic.TrainEA

All Implemented Interfaces:
  Serializable, EncogShutdownTask, EvolutionaryAlgorithm, MLTrain, MultiThreadable

Direct Known Subclasses:
  MLMethodGeneticAlgorithm.MLMethodGeneticAlgorithmHelper

    public class TrainEA

extends BasicEA
implements MLTrain

Provides a MLTrain compatible class that can be used to train genomes.

See Also:
  Serialized Form

Constructor Summary
`TrainEA(Population thePopulation, CalculateScore theScoreFunction)` Create a trainer for a score function.
`TrainEA(Population thePopulation, MLDataSet trainingData)` Create a trainer for training data.

Method Summary
`void` | `addStrategy(Strategy strategy)` Not supported, will throw an error.
`boolean` | `canContinue()`
`void` | `finishTraining()` Called when training is finished.
`TrainingImplementationType` | `getImplementationType()`
`MLMethod` | `getMethod()` Get the current best machine learning method from the training.
`List<Strategy>` | `getStrategies()` Returns an empty list, strategies are not supported.
`MLDataSet` | `getTraining()` Returns null, does not use a training set, rather uses a score function.
`boolean` | `isTrainingDone()`
`void` | `iteration(int count)` Perform the specified number of training iterations.
`TrainingContinuation` | `pause()` Pause the training to continue later.
`void` | `resume(TrainingContinuation state)` Resume training.
`void` | `setError(double error)` Not used.

Methods inherited from class org.encog.ml.ea.train.basic.BasicEA
`addChild, addOperation, addScoreAdjuster, calculateScore, calculateScoreAdjustment, getBestComparator, getBestGenome, getChampMutation, getCODEC, getEliteRate, getError, getIteration, getMaxIndividualSize, getMaxOperationErrors, getMaxTries, getOldBestGenome, getOperators, getPopulation, getRandomNumberFactory, getRules, getScoreAdjusters, getScoreFunction, getSelection, getSelectionComparator, getShouldIgnoreExceptions, getSpeciation, getThreadCount, isValidationMode, iteration, performShutdownTask, reportError, setBestComparator, setChampMutation, setCODEC, setEliteRate, setIteration, setMaxOperationErrors, setMaxTries, setPopulation, setRandomNumberFactory, setRules, setSelection, setSelectionComparator, setShouldIgnoreExceptions, setSpeciation, setThreadCount, setValidationMode`

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
`getError, getIteration, iteration, setIteration`

Constructor Detail

### TrainEA

    public TrainEA(Population thePopulation,
                   CalculateScore theScoreFunction)

  Create a trainer for a score function.

  Parameters:
    `thePopulation` - The population.
    `theScoreFunction` - The score function.

### TrainEA

    public TrainEA(Population thePopulation,
                   MLDataSet trainingData)

  Create a trainer for training data.

  Parameters:
    `thePopulation` - The population.
    `trainingData` - The training data.

Method Detail

### setError

    public void setError(double error)

  Not used.

  Specified by:
    `setError` in interface `MLTrain`
  Parameters:
    `error` - Not used.

### isTrainingDone

    public boolean isTrainingDone()

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

### getImplementationType

    public TrainingImplementationType getImplementationType()

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

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

### pause

    public TrainingContinuation pause()

  Pause the training to continue later.

  Specified by:
    `pause` in interface `MLTrain`
  Returns:
    A training continuation object.

### resume

    public void resume(TrainingContinuation state)

  Resume training.

  Specified by:
    `resume` in interface `MLTrain`
  Parameters:
    `state` - The training continuation object to use to continue.

### addStrategy

    public void addStrategy(Strategy strategy)

  Not supported, will throw an error.

  Specified by:
    `addStrategy` in interface `MLTrain`
  Parameters:
    `strategy` - Not used.

### canContinue

    public boolean canContinue()

  Specified by:
    `canContinue` in interface `MLTrain`
  Returns:
    True if the training can be paused, and later continued.

### finishTraining

    public void finishTraining()

  Called when training is finished. This allows the EA to properly shut down.

  Specified by:
    `finishTraining` in interface `EvolutionaryAlgorithm`
  Specified by:
    `finishTraining` in interface `MLTrain`
  Overrides:
    `finishTraining` in class `BasicEA`

### getMethod

    public MLMethod getMethod()

  Description copied from interface: `MLTrain`
  Get the current best machine learning method from the training.

  Specified by:
    `getMethod` in interface `MLTrain`
  Returns:
    A network created for the best genome.

### getTraining

    public MLDataSet getTraining()

  Returns null, does not use a training set, rather uses a score function.

  Specified by:
    `getTraining` in interface `MLTrain`
  Returns:
    null, not used.

### getStrategies

    public List<Strategy> getStrategies()

  Returns an empty list, strategies are not supported.

  Specified by:
    `getStrategies` in interface `MLTrain`
  Returns:
    The strategies in use(none).

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