Java源码示例:org.deeplearning4j.earlystopping.scorecalc.ScoreCalculator
示例1
@Override
public ScoreCalculator get() {
try {
return new DataSetLossCalculatorCG(new MnistDataSetIterator(4, 8), true);
} catch (Exception e){
throw new RuntimeException(e);
}
}
示例2
@Override
public ScoreCalculator get() {
try {
return new DataSetLossCalculatorCG(new MnistDataSetIterator(128, 1280), true);
} catch (Exception e){
throw new RuntimeException(e);
}
}
示例3
public ScoreCalculator<T> getScoreCalculator(){
if(scoreCalculatorSupplier != null){
return scoreCalculatorSupplier.get();
}
return scoreCalculator;
}
示例4
/** Score calculator. Used to calculate a score (such as loss function on a test set), every N epochs,
* where N is set by {@link #evaluateEveryNEpochs}
*/
public Builder<T> scoreCalculator(Supplier<ScoreCalculator> scoreCalculatorSupplier){
this.scoreCalculatorSupplier = scoreCalculatorSupplier;
return this;
}