【发布时间】:2018-12-19 23:26:42
【问题描述】:
deeplearning4j:如何在持久性级别存储/保存经过训练的模型,并在临时请求来评估深度学习模型时将其加载回来?
DataNormalization normalizer = new NormalizerStandardize();
normalizer.fit(trainingData); //Collect the statistics (mean/stdev) from the training data. This does not modify the input data
normalizer.transform(trainingData);
//run the model
MultiLayerNetwork model = new MultiLayerNetwork(conf);
model.init();
model.setListeners(new ScoreIterationListener(100));
for( int i=0; i<epochs; i++ ) {
model.fit(trainingData);
}
我需要存储训练好的模型。我怎样才能做到这一点?使用哪个 API?
//evaluate the model on the test set
Evaluation eval = new Evaluation(3);
INDArray output = model.output(testData.getFeatures());
eval.eval(testData.getLabels(), output);
log.info(eval.stats());
【问题讨论】:
标签: deeplearning4j