0%

Book Description

Use Java and Deeplearning4j to build robust, scalable, and highly accurate AI models from scratch

Key Features

  • Install and configure Deeplearning4j to implement deep learning models from scratch
  • Explore recipes for developing, training, and fine-tuning your neural network models in Java
  • Model neural networks using datasets containing images, text, and time-series data

Book Description

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.

What you will learn

  • Perform data normalization and wrangling using DL4J
  • Build deep neural networks using DL4J
  • Implement CNNs to solve image classification problems
  • Train autoencoders to solve anomaly detection problems using DL4J
  • Perform benchmarking and optimization to improve your model's performance
  • Implement reinforcement learning for real-world use cases using RL4J
  • Leverage the capabilities of DL4J in distributed systems

Who this book is for

If you are a data scientist, machine learning developer, or a deep learning enthusiast who wants to implement deep learning models in Java, this book is for you. Basic understanding of Java programming as well as some experience with machine learning and neural networks is required to get the most out of this book.

Table of Contents

  1. Title Page
  2. Copyright and Credits
    1. Java Deep Learning Cookbook
  3. Dedication
  4. About Packt
    1. Why subscribe?
  5. Contributors
    1. About the author
    2. About the reviewers
    3. Packt is searching for authors like you
  6. Preface
    1. Who this book is for
    2. What this book covers
    3. To get the most out of this book
      1. Download the example code files
      2. Download the color images
      3. Conventions used
    4. Sections
      1. Getting ready
      2. How to do it…
      3. How it works…
      4. There's more…
      5. See also
    5. Get in touch
      1. Reviews
  7. Introduction to Deep Learning in Java
    1. Technical requirements
    2. Deep learning intuition
      1. Backpropagation
      2. Multilayer Perceptron (MLP)
      3. Convolutional Neural Network (CNN)
      4. Recurrent Neural Network (RNN)
      5. Why is DL4J important for deep learning?
    3. Determining the right network type to solve deep learning problems
      1. How to do it...
      2. How it works...
      3. There's more...
    4. Determining the right activation function
      1. How to do it...
      2. How it works...
      3. There's more...
    5. Combating overfitting problems
      1. How to do it...
      2. How it works...
      3. There's more...
    6. Determining the right batch size and learning rates
      1. How to do it...
      2. How it works...
      3. There's more...
    7. Configuring Maven for DL4J
      1. Getting ready
      2. How to do it...
      3. How it works...
    8. Configuring DL4J for a GPU-accelerated environment
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    9. Troubleshooting installation issues
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
  8. Data Extraction, Transformation, and Loading
    1. Technical requirements
    2. Reading and iterating through data
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Performing schema transformations
      1. How to do it...
      2. How it works...
      3. There's more...
    4. Building a transformation process
      1. How to do it...
      2. How it works...
      3. There's more...
    5. Serializing transforms
      1. How to do it...
      2. How it works...
    6. Executing a transform process
      1. How to do it...
      2. How it works...
      3. There's more...
    7. Normalizing data for network efficiency
      1. How to do it...
      2. How it works...
      3. There's more...
  9. Building Deep Neural Networks for Binary Classification
    1. Technical requirements
    2. Extracting data from CSV input
      1. How to do it...
      2. How it works...
    3. Removing anomalies from the data
      1. How to do it...
      2. How it works...
      3. There's more...
    4. Applying transformations to the data
      1. How to do it...
      2. How it works...
    5. Designing input layers for the neural network model
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Designing hidden layers for the neural network model
      1. How to do it...
      2. How it works...
    7. Designing output layers for the neural network model
      1. How to do it...
      2. How it works...
    8. Training and evaluating the neural network model for CSV data
      1. How to do it...
      2. How it works...
      3. There's more...
    9. Deploying the neural network model and using it as an API
      1. Getting ready
      2. How to do it...
      3. How it works...
  10. Building Convolutional Neural Networks
    1. Technical requirements
    2. Extracting images from disk
      1. How to do it...
      2. How it works...
    3. Creating image variations for training data
      1. How to do it...
      2. How it works...
      3. There's more...
    4. Image preprocessing and the design of input layers
      1. How to do it...
      2. How it works...
    5. Constructing hidden layers for a CNN
      1. How to do it...
      2. How it works...
    6. Constructing output layers for output classification
      1. How to do it...
      2. How it works...
    7. Training images and evaluating CNN output
      1. How to do it...
      2. How it works...
      3. There's more...
    8. Creating an API endpoint for the image classifier
      1. How to do it...
      2. How it works...
  11. Implementing Natural Language Processing
    1. Technical requirements
      1. Data requirements
    2. Reading and loading text data
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
      5. See also
    3. Tokenizing data and training the model
      1. How to do it...
      2. How it works...
      3. There's more...
    4. Evaluating the model
      1. How to do it...
      2. How it works...
      3. There's more...
    5. Generating plots from the model
      1. Getting ready
      2. How to do it...
      3. How it works...
    6. Saving and reloading the model
      1. How to do it...
      2. How it works...
    7. Importing Google News vectors
      1. How to do it...
      2. How it works...
      3. There's more...
    8. Troubleshooting and tuning Word2Vec models
      1. How to do it...
      2. How it works...
      3. See also
    9. Using Word2Vec for sentence classification using CNNs
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    10. Using Doc2Vec for document classification
      1. How to do it...
      2. How it works...
  12. Constructing an LSTM Network for Time Series
    1. Technical requirements
    2. Extracting and reading clinical data
      1. How to do it...
      2. How it works...
    3. Loading and transforming data
      1. Getting ready
      2. How to do it...
      3. How it works...
    4. Constructing input layers for the network
      1. How to do it...
      2. How it works...
    5. Constructing output layers for the network
      1. How to do it...
      2. How it works...
    6. Training time series data
      1. How to do it...
      2. How it works...
    7. Evaluating the LSTM network's efficiency
      1. How to do it...
      2. How it works...
  13. Constructing an LSTM Neural Network for Sequence Classification
    1. Technical requirements
    2. Extracting time series data
      1. How to do it...
      2. How it works...
    3. Loading training data
      1. How to do it...
      2. How it works...
    4. Normalizing training data
      1. How to do it...
      2. How it works...
    5. Constructing input layers for the network
      1. How to do it...
      2. How it works...
    6. Constructing output layers for the network
      1. How to do it...
      2. How it works...
    7. Evaluating the LSTM network for classified output
      1. How to do it...
      2. How it works...
  14. Performing Anomaly Detection on Unsupervised Data
    1. Technical requirements
    2. Extracting and preparing MNIST data
      1. How to do it...
      2. How it works...
    3. Constructing dense layers for input
      1. How to do it...
      2. How it works...
    4. Constructing output layers
      1. How to do it...
      2. How it works...
    5. Training with MNIST images
      1. How to do it...
      2. How it works...
    6. Evaluating and sorting the results based on the anomaly score
      1. How to do it...
      2. How it works...
    7. Saving the resultant model
      1. How to do it...
      2. How it works...
      3. There's more...
  15. Using RL4J for Reinforcement Learning
    1. Technical requirements
    2. Setting up the Malmo environment and respective dependencies
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Setting up the data requirements
      1. How to do it...
      2. How it works...
      3. See also
    4. Configuring and training a DQN agent
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    5. Evaluating a Malmo agent
      1. Getting ready
      2. How to do it...
      3. How it works...
  16. Developing Applications in a Distributed Environment
    1. Technical requirements
    2. Setting up DL4J and the required dependencies
      1. Getting ready
      2. How to do it...
      3. How it works...
    3. Creating an uber-JAR for training
      1. How to do it...
      2. How it works...
    4. CPU/GPU-specific configuration for training
      1. How to do it...
      2. How it works...
      3. There's more...
    5. Memory settings and garbage collection for Spark
      1. How to do it...
      2. How it works...
      3. There's more...
    6. Configuring encoding thresholds
      1. How to do it...
      2. How it works...
      3. There's more...
    7. Performing a distributed test set evaluation
      1. How to do it...
      2. How it works....
    8. Saving and loading trained neural network models
      1. How to do it...
      2. How it works...
      3. There's more...
    9. Performing distributed inference
      1. How to do it...
      2. How it works...
  17. Applying Transfer Learning to Network Models
    1. Technical requirements
    2. Modifying an existing customer retention model
      1. How to do it...
      2. How it works...
      3. There's more...
    3. Fine-tuning the learning configurations
      1. How to do it...
      2. How it works...
    4. Implementing frozen layers
      1. How to do it...
      2. How it works...
    5. Importing and loading Keras models and layers
      1. Getting ready
      2. How to do it...
      3. How it works...
  18. Benchmarking and Neural Network Optimization
    1. Technical requirements
    2. DL4J/ND4J-specific configuration
      1. Getting ready
      2. How to do it...
      3. How it works...
      4. There's more...
    3. Setting up heap spaces and garbage collection
      1. How to do it...
      2. How it works...
      3. There's more...
      4. See also
    4. Using asynchronous ETL
      1. How to do it...
      2. How it works...
      3. There's more...
    5. Using arbiter to monitor neural network behavior
      1. How to do it...
      2. How it works...
    6. Performing hyperparameter tuning
      1. How to do it...
      2. How it works...
  19. Other Books You May Enjoy
    1. Leave a review - let other readers know what you think