Machine Learning Concepts with Java and DeepLearning4J

Introduction to DeepLearning4J

DeepLearning4J (or DL4J for short) is a Java based, commercial-grade, open-source, distributed deep-learning library. It can be used to create and combine various types of neural networks, train them and deploy the resulting models.

A quick look at DL4J’s Github repository reveals that it is accompanied by ND4J, a scientific computing library with an API that mimics the semantics of the well-established Python libraries Numpy and scikit-learn. This library provides the underlying matrix-based operations needed for the various algorithms used in DL4J. The combination of ND4J and DL4J enables us to read and prepare data sets, then train a neural network with this data and evaluate the results.

Both DL4J and ND4J are distributed under an Apache 2.0 License, which means anyone is free to make and patent derivative works as long as they don’t sue someone else over patent claims regarding the original code.

An important aspect of DL4J is its ability to take advantage of the latest distributed computing frameworks, including Apache Spark and Hadoop to accelerate training. It can also run on multi-GPUs for performance acceleration.

DL4J enables the user to define different types of networks and combine them as building blocks if needed. It can also import neural net models from other major frameworks (such as TensorFlow).

One way of deploying DL4J trained machine-learning models for inference in production is using the free community edition of SKIL, the Skymind Intelligence Layer. This method employs a model server that receives JSON based requests carrying data, and returns a decision or prediction about that data; for example, an image is sent in the request, and the model server returns a label for that image, identifying faces or animals in the image.

DL4J comes with plenty of documentation and tutorials that can be used as a great source of education for Machine Learning and Neural Networks. One of my favorites is the comprehensive Glossary page.

The Quickstart Guide describes how to clone and set up the DL4J set of examples using Maven and IntelliJ IDEA or Eclipse IDE.

In the next post, First DL4J Example, we will go over sample DL4J code implementing MNIST Classifier with a Single Layer MLP.

Tagged , , , , , ,

About Eyal Wirsansky

Eyal Wirsansky is a senior software developer, an artificial intelligence consultant and a genetic algorithms specialist, helping developers and startup companies learn and utilize artificial intelligence techniques. Eyal is the author of the book 'Hands-On Genetic Algorithms with Python' (Packt).
View all posts by Eyal Wirsansky →

Leave a Reply

Your email address will not be published. Required fields are marked *