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 doubleDEFAULT_MAX_ERRORThe default max error.static doubleDEFAULT_MIN_IMPROVEMENTThe default minimum improvement before stop.static intDEFAULT_NUM_SIGMASThe default number of sigmas to evaluate between the low and high.static doubleDEFAULT_SIGMA_HIGHThe default sigma high value.static doubleDEFAULT_SIGMA_LOWTHe default sigma low value.
-
Constructor Summary
Constructors Constructor and Description TrainBasicPNN(BasicPNN network, MLDataSet training)Train a BasicPNN.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecalcErrorWithMultipleSigma(double[] x, double[] der1, double[] der2, boolean der)Calculate the error with multiple sigmas.doublecalcErrorWithSingleSigma(double sig)Calculate the error using a common sigma.doublecalculateError(MLDataSet training, boolean deriv)Calculate the error for the entire training set.booleancanContinue()MLDatacomputeDeriv(MLData input, MLData target)Compute the derivative for target data.doublegetMaxError()MLMethodgetMethod()Get the current best machine learning method from the training.doublegetMinImprovement()intgetNumSigmas()doublegetSigmaHigh()doublegetSigmaLow()voiditeration()Perform one iteration of training.TrainingContinuationpause()Pause the training to continue later.voidresume(TrainingContinuation state)Resume training.voidsetMaxError(double maxError)voidsetMinImprovement(double minImprovement)voidsetNumSigmas(int numSigmas)voidsetSigmaHigh(double sigmaHigh)voidsetSigmaLow(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
-
-
-
-
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
-
-
Method Detail
-
calcErrorWithMultipleSigma
public double calcErrorWithMultipleSigma(double[] x, double[] der1, double[] der2, boolean der)Calculate the error with multiple sigmas.- Specified by:
calcErrorWithMultipleSigmain interfaceCalculationCriteria- 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:
calcErrorWithSingleSigmain interfaceCalculationCriteria- 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:
canContinuein interfaceMLTrain- 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.
-
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.
-
pause
public TrainingContinuation pause()
Pause the training to continue later.
-
resume
public void resume(TrainingContinuation state)
Resume training.
-
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
-
-
DMelt 3.0 © DataMelt by jWork.ORG