Deeplearning4j: Deep learning and ETL for the JVM

Aimed at integrating models with Java applications, Deeplearning4j offers a stack of components for building JVM-based applications that incorporate AI

1 2 Page 2
Page 2 of 2

Deeplearning4j performance

Benchmarking Java programs can be tricky. In particular, you need to warm up the code before timing it to eliminate the overhead of the JIT compiler, and you need to make sure that the JVM has enough RAM configured for the program being benchmarked. The Deeplearning4j community maintains a repository of benchmark code for a variety of popular models and configurations.

According to the developers, Deeplearning4j is as fast as Caffe for non-trivial image recognition tasks using multiple GPUs. To use multiple machines, you can run Deeplearning4j with Spark.

Deep learning for Java applications

Overall, Deeplearning4j is a worthy library for loading and conditioning data and performing deep learning on the Java VM. While not yet as mature as TensorFlow or PyTorch, Deeplearning4j will appeal to data scientists who want to integrate deep learning models into Java-based applications. Deeplearning4j’s ability to import Keras models will ease the transition for people who want to switch from TensorFlow.

Deeplearning4j supports creating graphs and then running them, like TensorFlow 1. It doesn’t support immediate mode training, like TensorFlow 2 and PyTorch. That doesn’t matter much for production, but it might make using Deeplearning4j less attractive for research.

Deeplearning4j currently has two mechanisms for distributed training, parameter averaging and gradient sharing. The latter is preferable, but it was only added to the library in Version 1.0.0-beta3. Deeplearning4j is also integrated with Spark, which helps to support training on a cluster of machines. Using Spark doesn’t really help when training on a single server with multiple GPUs.

We look forward to Deeplearning4j 1.0 emerging from beta test.

Cost: Free open source under the Apache 2.0 license. 

Platform: Windows, macOS, Linux; Java 7 or later and Maven required.

At a Glance
  • Deeplearning4j is a worthy library for loading and conditioning data and performing deep learning on the Java Virtual Machine, providing a core set of components for building applications that incorporate AI.

    Pros

    • Supports CPUs, MKL, and CUDA
    • Capable of performing distributed training
    • Incorporates ETL as part of the library
    • About as efficient as other deep learning libraries on the same hardware
    • Can import Keras models

    Cons

    • Not as mature as TensorFlow or PyTorch
    • No immediate mode support as yet

Copyright © 2020 IDG Communications, Inc.

1 2 Page 2
Page 2 of 2