org.encog.neural.networks.training.pnn

## Class TrainBasicPNN

- java.lang.Object
- - org.encog.ml.train.BasicTraining
  - - org.encog.neural.networks.training.pnn.TrainBasicPNN

- All Implemented Interfaces:
    MLTrain, CalculationCriteria

      public class TrainBasicPNN
      extends BasicTraining
      implements CalculationCriteria

  Train a PNN.

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static double` | `DEFAULT_MAX_ERROR` The default max error.
    `static double` | `DEFAULT_MIN_IMPROVEMENT` The default minimum improvement before stop.
    `static int` | `DEFAULT_NUM_SIGMAS` The default number of sigmas to evaluate between the low and high.
    `static double` | `DEFAULT_SIGMA_HIGH` The default sigma high value.
    `static double` | `DEFAULT_SIGMA_LOW` THe default sigma low value.

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TrainBasicPNN(BasicPNN network, MLDataSet training)` Train a BasicPNN.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `double` | `calcErrorWithMultipleSigma(double[] x, double[] der1, double[] der2, boolean der)` Calculate the error with multiple sigmas.
    `double` | `calcErrorWithSingleSigma(double sig)` Calculate the error using a common sigma.
    `double` | `calculateError(MLDataSet training, boolean deriv)` Calculate the error for the entire training set.
    `boolean` | `canContinue()`
    `MLData` | `computeDeriv(MLData input, MLData target)` Compute the derivative for target data.
    `double` | `getMaxError()`
    `MLMethod` | `getMethod()` Get the current best machine learning method from the training.
    `double` | `getMinImprovement()`
    `int` | `getNumSigmas()`
    `double` | `getSigmaHigh()`
    `double` | `getSigmaLow()`
    `void` | `iteration()` Perform one iteration of training.
    `TrainingContinuation` | `pause()` Pause the training to continue later.
    `void` | `resume(TrainingContinuation state)` Resume training.
    `void` | `setMaxError(double maxError)`
    `void` | `setMinImprovement(double minImprovement)`
    `void` | `setNumSigmas(int numSigmas)`
    `void` | `setSigmaHigh(double sigmaHigh)`
    `void` | `setSigmaLow(double sigmaLow)`

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

    - #### DEFAULT_MAX_ERROR

          public static final double DEFAULT_MAX_ERROR

      The default max error.
      See Also:
        Constant Field Values

    - #### DEFAULT_MIN_IMPROVEMENT

          public static final double DEFAULT_MIN_IMPROVEMENT

      The default minimum improvement before stop.
      See Also:
        Constant Field Values

    - #### DEFAULT_SIGMA_LOW

          public static final double DEFAULT_SIGMA_LOW

      THe default sigma low value.
      See Also:
        Constant Field Values

    - #### DEFAULT_SIGMA_HIGH

          public static final double DEFAULT_SIGMA_HIGH

      The default sigma high value.
      See Also:
        Constant Field Values

    - #### DEFAULT_NUM_SIGMAS

          public static final int DEFAULT_NUM_SIGMAS

      The default number of sigmas to evaluate between the low and high.
      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### TrainBasicPNN

          public TrainBasicPNN(BasicPNN network,
                       MLDataSet training)

      Train a BasicPNN.
      Parameters:
        `network` - The network to train.
        `training` - The training data.

  - ### Method Detail

    - #### calcErrorWithMultipleSigma

          public double calcErrorWithMultipleSigma(double[] x,
                                          double[] der1,
                                          double[] der2,
                                          boolean der)

      Calculate the error with multiple sigmas.
      Specified by:
        `calcErrorWithMultipleSigma` in interface `CalculationCriteria`
      Parameters:
        `x` - The data.
        `der1` - The first derivative.
        `der2` - The 2nd derivatives.
        `der` - Calculate the derivative.
      Returns:
        The error.

    - #### calcErrorWithSingleSigma

          public double calcErrorWithSingleSigma(double sig)

      Calculate the error using a common sigma.
      Specified by:
        `calcErrorWithSingleSigma` in interface `CalculationCriteria`
      Parameters:
        `sig` - The sigma to use.
      Returns:
        The training error.

    - #### calculateError

          public double calculateError(MLDataSet training,
                              boolean deriv)

      Calculate the error for the entire training set.
      Parameters:
        `training` - Training set to use.
        `deriv` - Should we find the derivative.
      Returns:
        The error.

    - #### canContinue

          public boolean canContinue()

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

    - #### computeDeriv

          public MLData computeDeriv(MLData input,
                            MLData target)

      Compute the derivative for target data.
      Parameters:
        `input` - The input.
        `target` - The target data.
      Returns:
        The output.

    - #### getMaxError

          public double getMaxError()

      Returns:
        the maxError

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

    - #### getMinImprovement

          public double getMinImprovement()

      Returns:
        the minImprovement

    - #### getNumSigmas

          public int getNumSigmas()

      Returns:
        the numSigmas

    - #### getSigmaHigh

          public double getSigmaHigh()

      Returns:
        the sigmaHigh

    - #### getSigmaLow

          public double getSigmaLow()

      Returns:
        the sigmaLow

    - #### iteration

          public void iteration()

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

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

    - #### setMaxError

          public void setMaxError(double maxError)

      Parameters:
        `maxError` - the maxError to set

    - #### setMinImprovement

          public void setMinImprovement(double minImprovement)

      Parameters:
        `minImprovement` - the minImprovement to set

    - #### setNumSigmas

          public void setNumSigmas(int numSigmas)

      Parameters:
        `numSigmas` - the numSigmas to set

    - #### setSigmaHigh

          public void setSigmaHigh(double sigmaHigh)

      Parameters:
        `sigmaHigh` - the sigmaHigh to set

    - #### setSigmaLow

          public void setSigmaLow(double sigmaLow)

      Parameters:
        `sigmaLow` - the sigmaLow to set

Copyright © 2014. All Rights Reserved.