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

Evaluating the model

Once the training has been completed, the next task would be evaluating the model. We will evaluate the model's performance on the test set. For the evaluation, we will be using Evaluation(). This method  creates an evaluation object with five possible classes. First, let's iterate the evaluation over every test sample and get the network's prediction from the trained model. Finally, the eval() method checks the prediction against the true class:

log.info("Evaluate model....");Evaluation eval = new Evaluation(5) // for 5 classeswhile(testDataIt.hasNext()){        DataSet next = testDataIt.next();        INDArray output = model.output(next.getFeatureMatrix());        eval.eval(next.getLabels(), output);}log.info(eval.stats());log.info("****************Example ...

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