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

Network training

First, we create a MultiLayerNetwork  using the preceding MultiLayerConfiguration. Then we initialize the network and start the training on the training set:

MultiLayerNetwork model = new MultiLayerNetwork(LSTMconf);model.init();log.info("Train model....");for(int i=0; i<numEpochs; i++ ){    model.fit(trainingDataIt); }

Typically, this type of network has so many hyperparameters. Let's print the number of parameters in the network (and for each layer):

Layer[] layers = model.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 += nParams;}System.out.println("Total number of network ...

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