org.encog.neural.networks.training
Class StochasticTrainingSetScore
- java.lang.Object
-
- org.encog.neural.networks.training.StochasticTrainingSetScore
-
- All Implemented Interfaces:
- CalculateScore
public class StochasticTrainingSetScore extends java.lang.Object implements CalculateScore
Calculate a score based on a training set. This class allows simulated annealing or genetic algorithms just as you would any other training set based training method. The method must support regression (MLRegression). A random sample is used to score the model.
-
-
Constructor Summary
Constructors Constructor and Description StochasticTrainingSetScore(MLDataSet training, int theSize)Construct a training set score calculation.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description doublecalculateScore(MLMethod method)Calculate the score for the network.GenerateRandomgetRnd()intgetSize()MLDataSetgetTraining()booleanrequireSingleThreaded()voidsetRnd(GenerateRandom rnd)booleanshouldMinimize()A training set based score should always seek to lower the error, as a result, this method always returns true.
-
-
-
Constructor Detail
-
StochasticTrainingSetScore
public StochasticTrainingSetScore(MLDataSet training, int theSize)
Construct a training set score calculation.- Parameters:
training- The training data to use.
-
-
Method Detail
-
calculateScore
public double calculateScore(MLMethod method)
Calculate the score for the network.- Specified by:
calculateScorein interfaceCalculateScore- Parameters:
method- The network to calculate for.- Returns:
- The score.
-
shouldMinimize
public boolean shouldMinimize()
A training set based score should always seek to lower the error, as a result, this method always returns true.- Specified by:
shouldMinimizein interfaceCalculateScore- Returns:
- Returns true.
-
requireSingleThreaded
public boolean requireSingleThreaded()
- Specified by:
requireSingleThreadedin interfaceCalculateScore- Returns:
- True, if this score function cannot be done in parallel.
-
getTraining
public MLDataSet getTraining()
-
getSize
public int getSize()
-
getRnd
public GenerateRandom getRnd()
-
setRnd
public void setRnd(GenerateRandom rnd)
-
-
DMelt 3.0 © DataMelt by jWork.ORG