Class DataSetLossCalculator
- java.lang.Object
-
- org.deeplearning4j.earlystopping.scorecalc.base.BaseScoreCalculator<Model>
-
- org.deeplearning4j.earlystopping.scorecalc.DataSetLossCalculator
-
- All Implemented Interfaces:
Serializable
,ScoreCalculator<Model>
public class DataSetLossCalculator extends BaseScoreCalculator<Model>
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.deeplearning4j.earlystopping.scorecalc.base.BaseScoreCalculator
exampleCount, iterator, mdsIterator, minibatchCount, scoreSum
-
-
Constructor Summary
Constructors Constructor Description DataSetLossCalculator(DataSetIterator dataSetIterator, boolean average)
Calculate the score (loss function value) on a given data set (usually a test set)DataSetLossCalculator(MultiDataSetIterator dataSetIterator, boolean average)
Calculate the score (loss function value) on a given data set (usually a test set)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected double
finalScore(double scoreSum, int minibatchCount, int exampleCount)
boolean
minimizeScore()
protected INDArray[]
output(Model network, INDArray[] input, INDArray[] fMask, INDArray[] lMask)
protected INDArray
output(Model network, INDArray input, INDArray fMask, INDArray lMask)
protected void
reset()
protected double
scoreMinibatch(Model network, INDArray[] features, INDArray[] labels, INDArray[] fMask, INDArray[] lMask, INDArray[] output)
String
toString()
-
Methods inherited from class org.deeplearning4j.earlystopping.scorecalc.base.BaseScoreCalculator
arr, calculateScore, get0, scoreMinibatch
-
-
-
-
Constructor Detail
-
DataSetLossCalculator
public DataSetLossCalculator(DataSetIterator dataSetIterator, boolean average)
Calculate the score (loss function value) on a given data set (usually a test set)- Parameters:
dataSetIterator
- Data set to calculate the score foraverage
- Whether to return the average (sum of loss / N) or just (sum of loss)
-
DataSetLossCalculator
public DataSetLossCalculator(MultiDataSetIterator dataSetIterator, boolean average)
Calculate the score (loss function value) on a given data set (usually a test set)- Parameters:
dataSetIterator
- Data set to calculate the score foraverage
- Whether to return the average (sum of loss / N) or just (sum of loss)
-
-
Method Detail
-
reset
protected void reset()
- Specified by:
reset
in classBaseScoreCalculator<Model>
-
output
protected INDArray output(Model network, INDArray input, INDArray fMask, INDArray lMask)
- Specified by:
output
in classBaseScoreCalculator<Model>
-
output
protected INDArray[] output(Model network, INDArray[] input, INDArray[] fMask, INDArray[] lMask)
- Specified by:
output
in classBaseScoreCalculator<Model>
-
scoreMinibatch
protected double scoreMinibatch(Model network, INDArray[] features, INDArray[] labels, INDArray[] fMask, INDArray[] lMask, INDArray[] output)
- Specified by:
scoreMinibatch
in classBaseScoreCalculator<Model>
-
finalScore
protected double finalScore(double scoreSum, int minibatchCount, int exampleCount)
- Specified by:
finalScore
in classBaseScoreCalculator<Model>
-
minimizeScore
public boolean minimizeScore()
- Returns:
- If true: the score should be minimized. If false: the score should be maximized.
-
-