Skip to Content
Java Deep Learning Projects
book

Java Deep Learning Projects

by Md. Rezaul Karim
June 2018
Intermediate to advanced
436 pages
10h 33m
English
Packt Publishing
Content preview from Java Deep Learning Projects

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Java Deep Learning Essentials

Java Deep Learning Essentials

Yusuke Sugomori
Machine Learning in Java - Second Edition

Machine Learning in Java - Second Edition

AshishSingh Bhatia, Bostjan Kaluza
Mastering Java Machine Learning

Mastering Java Machine Learning

Uday Kamath, Krishna Choppella

Publisher Resources

ISBN: 9781788997454Supplemental Content