November 2019
Intermediate to advanced
304 pages
8h 40m
English
Content preview from Java Deep Learning Cookbook
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,
Start your free trial



Getting ready
As a prerequisite for API creation, you need to run the main example source code: https://github.com/PacktPublishing/Java-Deep-Learning-Cookbook/blob/master/03_Building_Deep_Neural_Networks_for_Binary_classification/sourceCode/cookbookapp/src/main/java/com/javadeeplearningcookbook/examples/CustomerRetentionPredictionExample.java
DL4J has a utility class called ModelSerializer to save and restore models. We have used ModelSerializer to persist the model to disk, as follows:
File file = new File("model.zip"); ModelSerializer.writeModel(multiLayerNetwork,file,true); ModelSerializer.addNormalizerToModel(file,dataNormalization);
For more information, refer to: