org.encog.neural.freeform.training

## Class FreeformPropagationTraining

- java.lang.Object
- - org.encog.ml.train.BasicTraining
  - - org.encog.neural.freeform.training.FreeformPropagationTraining

- All Implemented Interfaces:
    Serializable, MLTrain
  Direct Known Subclasses:
    FreeformBackPropagation, FreeformResilientPropagation

      public abstract class FreeformPropagationTraining
      extends BasicTraining
      implements Serializable

  Provides basic propagation functions to other trainers.
  See Also:
    Serialized Form

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `FLAT_SPOT_CONST` The constant to use to fix the flat spot problem.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `FreeformPropagationTraining()` Don't use this constructor, it is for serialization only.
    `FreeformPropagationTraining(FreeformNetwork theNetwork, MLDataSet theTraining)` Construct the trainer.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `canContinue()`
    `void` | `finishTraining()` Should be called after training has completed and the iteration method will not be called any further.
    `int` | `getBatchSize()`
    `double` | `getError()`
    `TrainingImplementationType` | `getImplementationType()`
    `int` | `getIteration()`
    `MLMethod` | `getMethod()` Get the current best machine learning method from the training.
    `MLDataSet` | `getTraining()`
    `boolean` | `isFixFlatSopt()`
    `void` | `iteration()` Perform one iteration of training.
    `void` | `iteration(int count)` Perform the specified number of training iterations.
    `protected void` | `learn()` Learn for the entire network.
    `protected abstract void` | `learnConnection(FreeformConnection connection)` Learn for a single connection.
    `protected void` | `processBatches()` Process training batches.
    `protected void` | `processPureBatch()` Process training for pure batch mode (one single batch).
    `void` | `setBatchSize(int batchSize)` Set the batch size.
    `void` | `setError(double theError)`
    `void` | `setFixFlatSopt(boolean fixFlatSopt)` Set if we should fix the flat spot problem.
    `void` | `setIteration(int iteration)` Set the current training iteration.

    - ### Methods inherited from class org.encog.ml.train.BasicTraining

      `addStrategy, getStrategies, isTrainingDone, postIteration, preIteration, setTraining`

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

      `pause, resume`

- - ### Field Detail

    - #### FLAT_SPOT_CONST

          public static final double FLAT_SPOT_CONST

      The constant to use to fix the flat spot problem.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### FreeformPropagationTraining

          public FreeformPropagationTraining()

      Don't use this constructor, it is for serialization only.

    - #### FreeformPropagationTraining

          public FreeformPropagationTraining(FreeformNetwork theNetwork,
                                     MLDataSet theTraining)

      Construct the trainer.
      Parameters:
        `theNetwork` - The network to train.
        `theTraining` - The training data.

  - ### Method Detail

    - #### 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()

      Should be called after training has completed and the iteration method will not be called any further.
      Specified by:
        `finishTraining` in interface `MLTrain`
      Overrides:
        `finishTraining` in class `BasicTraining`

    - #### getError

          public double getError()

      Specified by:
        `getError` in interface `MLTrain`
      Overrides:
        `getError` in class `BasicTraining`
      Returns:
        Returns the training error. This value is calculated as the training data is evaluated by the iteration function. This has two important ramifications. First, the value returned by getError() is meaningless prior to a call to iteration. Secondly, the error is calculated BEFORE training is applied by the call to iteration. The timing of the error calculation is done for performance reasons.

    - #### getImplementationType

          public TrainingImplementationType getImplementationType()

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

    - #### getIteration

          public int getIteration()

      Specified by:
        `getIteration` in interface `MLTrain`
      Overrides:
        `getIteration` in class `BasicTraining`
      Returns:
        the iteration

    - #### getMethod

          public MLMethod getMethod()

      Get the current best machine learning method from the training.
      Specified by:
        `getMethod` in interface `MLTrain`
      Returns:
        The best machine learningm method.

    - #### getTraining

          public MLDataSet getTraining()

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

    - #### isFixFlatSopt

          public boolean isFixFlatSopt()

      Returns:
        True, if we are fixing the flat spot problem.

    - #### iteration

          public void iteration()

      Perform one iteration of training.
      Specified by:
        `iteration` in interface `MLTrain`

    - #### 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`
      Overrides:
        `iteration` in class `BasicTraining`
      Parameters:
        `count` - The number of training iterations.

    - #### processPureBatch

          protected void processPureBatch()

      Process training for pure batch mode (one single batch).

    - #### processBatches

          protected void processBatches()

      Process training batches.

    - #### learn

          protected void learn()

      Learn for the entire network.

    - #### learnConnection

          protected abstract void learnConnection(FreeformConnection connection)

      Learn for a single connection.
      Parameters:
        `connection` - The connection to learn from.

    - #### setError

          public void setError(double theError)

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

    - #### setFixFlatSopt

          public void setFixFlatSopt(boolean fixFlatSopt)

      Set if we should fix the flat spot problem.
      Parameters:
        `fixFlatSopt` - True, if we should fix the flat spot problem.

    - #### setIteration

          public void setIteration(int iteration)

      Set the current training iteration.
      Specified by:
        `setIteration` in interface `MLTrain`
      Overrides:
        `setIteration` in class `BasicTraining`
      Parameters:
        `iteration` - the iteration to set

    - #### getBatchSize

          public int getBatchSize()

      Returns:
        The batch size.

    - #### setBatchSize

          public void setBatchSize(int batchSize)

      Set the batch size.
      Parameters:
        `batchSize` - The batch size.

Copyright © 2014. All Rights Reserved.