Book Image

Java Deep Learning Cookbook

By : Rahul Raj
Book Image

Java Deep Learning Cookbook

By: Rahul Raj

Overview of this book

Java is one of the most widely used programming languages in the world. With this book, you will see how to perform deep learning using Deeplearning4j (DL4J) – the most popular Java library for training neural networks efficiently. This book starts by showing you how to install and configure Java and DL4J on your system. You will then gain insights into deep learning basics and use your knowledge to create a deep neural network for binary classification from scratch. As you progress, you will discover how to build a convolutional neural network (CNN) in DL4J, and understand how to construct numeric vectors from text. This deep learning book will also guide you through performing anomaly detection on unsupervised data and help you set up neural networks in distributed systems effectively. In addition to this, you will learn how to import models from Keras and change the configuration in a pre-trained DL4J model. Finally, you will explore benchmarking in DL4J and optimize neural networks for optimal results. By the end of this book, you will have a clear understanding of how you can use DL4J to build robust deep learning applications in Java.
Table of Contents (14 chapters)

To get the most out of this book

Readers are expected to have basic knowledge of deep learning, reinforcement learning, and data analytics. Basic knowledge of deep learning will help you understand the neural network design and the various hyperparameters used in the examples. Basic data analytics skills and an understanding of data requirements will help you to explore DataVec better, while some prior knowledge of the basics of reinforcement learning will help you while working through Chapter 9, Using RL4J for Reinforcement Learning. We will also be discussing distributed neural networks in Chapter 10, Developing Applications in a Distributed Environment, for which basic knowledge of Apache Spark is preferred.

Download the example code files

You can download the example code files for this book from your account at www.packt.com. If you purchased this book elsewhere, you can visit www.packtpub.com/support and register to have the files emailed directly to you.

You can download the code files by following these steps:

  1. Log in or register at www.packt.com.
  2. Select the Support tab.
  3. Click on Code Downloads.
  4. Enter the name of the book in the Search box and follow the onscreen instructions.

Once the file is downloaded, please make sure that you unzip or extract the folder using the latest version of:

  • WinRAR/7-Zip for Windows
  • Zipeg/iZip/UnRarX for Mac
  • 7-Zip/PeaZip for Linux

The code bundle for the book is also hosted on GitHub at https://github.com/PacktPublishing/Java-Deep-Learning-Cookbook. In case there's an update to the code, it will be updated on the existing GitHub repository.

We also have other code bundles from our rich catalog of books and videos available at https://github.com/PacktPublishing/. Check them out!

Download the color images

Conventions used

There are a number of text conventions used throughout this book.

CodeInText: Indicates code words in text, database table names, folder names, filenames, file extensions, pathnames, dummy URLs, user input, and Twitter handles. Here is an example: "Create a CSVRecordReader to hold customer churn data."

A block of code is set as follows:

File file = new File("Churn_Modelling.csv");
recordReader.initialize(new FileSplit(file));

Any command-line input or output is written as follows:

mvn clean install

Bold: Indicates a new term, an important word, or words that you see on screen. For example, words in menus or dialog boxes appear in the text like this. Here is an example: "We just need to click on the Model tab on the left-hand sidebar."

Warnings or important notes appear like this.
Tips and tricks appear like this.