Monitoring the performance

What we did for monitoring previously was adding the listener, which outputs the training score of the model after each iteration:

MultiLayerNetwork model = new MultiLayerNetwork(network.build())ScoreIterationListener scoreListener = new ScoreIterationListener(1);model.setListeners(scoreListener);

This will give you some idea of the performance of the model, but only on the training data, but we typically need more than that--at least the performance on the validation set would be useful to know to see if we start overfitting or not.

So, let's read the validation dataset:

DataSetIterator valSet = datasetIterator(valUris);valSet.setPreProcessor(preprocessor);

 

For training, previously we just took the dataset ...

Get Java: Data Science Made Easy now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.