June 2018
Intermediate to advanced
436 pages
10h 33m
English
Now that we have finished the training, and the trained model is at hand, we can either directly use that trained one on the fly as well as restore the saved model from disk, or start the inferencing. Take a look at this code:
System.out.println("Restoring model...");net = ModelSerializer.restoreMultiLayerNetwork(locationToSave);//print the score with every 1 iterationnet.setListeners(new ScoreIterationListener(1));//Print the number of parameters in the network (and for each layer)Layer[] layers = net.getLayers(); int totalNumParams = 0;for( int i=0; i<layers.length; i++ ){ int nParams = layers[i].numParams(); System.out.println("Number of parameters in layer " + i + ": " + nParams); totalNumParams ...Read now
Unlock full access