O'Reilly logo

Java Deep Learning Projects by Md. Rezaul Karim

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Restoring the trained model and inferencing

Now that we have seen how our model performed, it would be worth exploring the feasibility of restoring the already trained model. In other words, we will restore the trained model and evaluate the network performance on both validation and test sets:

private static final String TRAINED_PATH_MODEL = "bin/CatvsDog_VG16_TrainedModel_Epoch100_v1.zip";ComputationGraph computationGraph = ModelSerializer.restoreComputationGraph(new File(TRAINED_PATH_MODEL));VG16CatvDogEvaluator().runOnTestSet(computationGraph);VG16CatvDogEvaluator().runOnValidationSet(computationGraph);

In the previous line, of code, first, we restored the trained model from the disk; then we performed the evaluation on both the test ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required