Deeplearning4j library, deep learning in enterprise big data applications

Eclipse Deeplearning4J (DL4J) is a framework that includes deep learning tools and libraries designed to take full advantage of the JavaTM Virtual Machine (JVM). It has distributed deep learning libraries written for the Java and Scala languages ​​and has built-in integration with Apache Hadoop and Spark. Deeplearning4j helps bridge the gap between data scientists using the Python language and enterprise developers using the Java language, simplifying the process of deploying deep learning in enterprise big data applications.

The DL4J can run on distributed CPUs and graphics processing units (GPUs). Both community and enterprise versions are available.

Eclipse Deeplearning4J framework

Skymind

Skymind is a San Francisco-based artificial intelligence (AI) startup founded by DL4J chief developer Adam Gibson and others. Skymind sells business support services and training services for the DL4J ecosystem. In addition, the company's Skymind Intelligence Layer platform bridges the gap between Python applications and the enterprise JVM.

The IBM® PowerAI team has ported DL4J to PowerAI. Subsequently, the team worked with Skymind to integrate DL4J into the IBM POWER8® architecture, including using NVLink to provide NVIDIA® GPU support.

DL4J was developed in collaboration with a group of open source contributors from San Francisco and Tokyo. In late 2014, they released it as an open source framework under the Apache 2.0 license. It is primarily used as a platform through which commercial deep learning algorithms are deployed. Skymind was founded in 2014 as a commercial support organization for DL4J.

In October 2017, Skymind joined the Eclipse Foundation and contributed DL4J to the open source Java Enterprise Edition library ecosystem. With the support of the Eclipse Foundation, people can be more certain that the DL4J project will be properly supervised, while also ensuring that a suitable open source license is available for commercial development. Java AI developers have regarded DL4J as a mature and secure framework, so these newly established partnerships will attract companies to use DL4J in the business world.

Deep learning in enterprise big data applications

Data scientists use Python to develop deep learning algorithms. In contrast, enterprise big data applications tend to use the Java platform. Therefore, to fill gaps and deploy deep learning in big data applications, DL4J developers must innovate on several solutions.

The adoption of Keras application programming interface (API) specifications helps to import deep learning models from other frameworks (eg TensorFlow, Caffe, Microsoft® Cognitive Toolkit (CNTK) and Theano). The Keras API is accessible through the JVM language (for example, Java, Scala, Clojure, and even Kotlin), making the deep learning model available to Java developers.

Not familiar with Keras? Read the tutorial: "Getting Started with Keras"

When running deep learning high-performance computing workloads on the JVM, there are many challenges. Java features such as memory management and garbage collection can affect performance, especially when using larger memory. DL4J bypassed some of these limitations.

Library in Deeplearning4j Framework

Deeplearing4j refers to both the framework software distribution and the specific library in the framework. The DL4J framework contains the following libraries:

DL4J library

ND4J library

Datavec library

Libnd4j library

RL4J library

Jumpy library

Arbiter library

Deeplearning4j library

The Deeplearning4j library is actually a neural network platform. It contains various tools for configuring neural networks and building computational graphs. Developers use this library to build neural network models that are integrated with data pipelines and Spark.

In addition to the core libraries, the DL4J library contains many other libraries for specific functions:

Deeplearning4j-core. The deeplearning4j-core library contains all the functions needed to run DL4J, such as the user interface (UI). It also has the tools and utilities needed to build a neural network.

Deeplearning4j-cuda. The deeplearning4j-cuda library supports DL4J running on GPUs using the NVIDIA CUDA® Deep Neural Network Library (CuDNN). This library supports standardization as well as convolutional neural networks and recursive neural networks.

Deeplearning4j-graph. The deeplearning4j-graph library performs graphics processing to construct the graphics vectorization model used in DeepWalk, an unsupervised learning algorithm for learning the vector representation of each vertex in the graph. You can use these learned vector representations to classify, group, or search for similar data in a graph.

Deeplearning4j-modelimport. The deeplearning4j-modelimport library imports models from Keras, and Keras can import models from Theano, TensorFlow, Caffe, and CNTK. This is the key DL4J library that supports importing models from other frameworks into DL4J.

Deeplearning4j-nlp-parent. The deeplearning4j-nlp-parent library supports integrating DL4J with external natural language processing (NLP) plug-ins and tools. This interface follows the Unstructured Information Management Architecture (UIMA), originally an open standard developed by IBM for content analysis. This library also contains text analysis for English, Chinese, Japanese, and Korean.

Deeplearning4j-nlp. The deeplearning4j-nlp library is a collection of NLP tools such as Word2Vec and Doc2Vec. Word2Vec is a double-layer neural network for processing text. Word2Vec is useful for grouping similar word vectors in "vector space." Doc2Vec is an extension of Word2Vec used to learn to associate tags with words instead of associating different words.

Deeplearning4j-nn. The deeplearning4j-nn library is a streamlined version of the core library that reduces dependencies. It uses builder mode to set hyperparameters, configures multi-layer networks, and supports the use of design patterns to construct neural networks in Java.

Deeplearning4j-scaleout. The deeplearning4j-scaleout library is a collection of libraries for use with Amazon Web Services servers and encapsulates Spark parallel code to run on regular servers up to 96 cores instead of Spark. This library also helps configure NLP on Spark and Spark, which includes Kafka and other video analysis streaming options.

Deeplearning4j-ui-parent. The deeplearning4j-ui-parent library is actually a DL4J UI and contains neural network training heuristics and visualization tools.

ND4J library

N-Dimensional Arrays for Java (ND4J) is a scientific computing C++ library, similar to Python's NumPy. It supports multiple languages ​​running on the JVM, such as Java, Scala, Clojure, and Kotlin. You can use ND4J to perform a linear algebra or operation matrix. ND4J can be integrated with Hadoop or Spark and thus extended to run on distributed CPUs and GPUs.

Java AI developers can use ND4J to define N-dimensional arrays in Java, which enables them to perform tensor operations on the JVM. ND4J uses "out of heap" memory outside the JVM to store tensors. The JVM only holds pointers to this external memory, and the Java program passes these pointers through the Java Native Interface (JNI) to the ND4J C++ backend code. This structure provides better performance when used with tensors from native code (for example, Basic Linear Algebra Subroutines (BLAS) and CUDA libraries). ND4J is integrated with Spark and can use different backends to run on CPUs or GPUs. The Scala API ND4S helps with this integration. When discussing how DL4J uses hardware acceleration in a later section, the ND4J architecture will be revisited.

Datavec library

The main function of the DataVec library is to format data as tensors. Through this preprocessing, neural networks can access and use data. DataVec performs extract, transform, and load (ETL) operations while also supporting connection to various data sources and output tensors through a series of data transformations. DL4J supports a wide range of data types, including images, comma separated values ​​(CSV), attribute associated file formats (ARFF), and plain text. DL4J also supports Apache Camel integration.

Libnd4j library

Libnd4j is a pure C ++ library that supports ND4J access BLAS linear algebra functions belong to and the Intel Math Kernel Library. It works closely with the JavaCPP open source library. JavaCPP is not part of the DL4J framework project, but the developers who support this code are the same.

Jumpy library

Jumpy is a Python library that allows NumPy to use the ND4J library without moving data. This library implements wrappers for NumPy and Pyjnius. MLlib or PySpark developers can use Jumpy to use NumPy arrays on the JVM.

Arbiter library

DL4J uses this tool to automatically tune neural networks. Various methods such as grid search, random search, and Bayesian methods can be used to optimize complex models with many hyperparameters to improve performance.

The Deeplearning4J Advantage

The DL4J has many advantages. Let us understand the three major advantages.

Python can interoperate with Java, Scala, Clojure, and Kotlin.

Python is widely used by data scientists, and big data programmers use Java or Scala to work on Hadoop and Spark. DL4J bridges the gap between developers and developers can migrate between Python and JVM languages ​​such as Java, Scala, Clojure, and Kotlin.

Using the Keras API, DL4J supports migration of deep learning models from other frameworks (eg TensorFlow, Caffe, Theano, and CNTK). Some even suggested DL4J as one of the back end of Keras's official contributions.

Distributed processing

DL4J runs on the latest distributed computing platforms such as Hadoop and Spark, and can be accelerated using distributed CPUs or GPUs. By using multiple GPUs, DL4J can achieve performance comparable to Caffe. The DL4J can also run on many cloud computing platforms, including the IBM Cloud.

Parallel processing

DL4J includes single-threaded options and distributed multi-threading options. This method of reducing the number of iterations can train multiple neural networks in parallel in a cluster. Therefore, DL4J is well suited for designing applications using the microservice architecture.

Eclipse DL4J application

The DL4J has a variety of applications, from graphics processing to NLP. With built-in data pre-processing and vectorization tools, the DL4J can handle many different data formats with exceptional flexibility. The Keras API also makes it easier to use pre-trained models from other frameworks.

Typical DL4J applications include:

Security applications such as fraud detection and network intrusion detection

Recommendation systems used in customer relationship management, ad push, and customer loyalty and retention

Regression and Forecast Analysis for Internet of Things and Other Streaming Data

Traditional facial recognition and image recognition applications

Voice search and voice transcription applications

Prophylactic diagnosis and anomaly detection for hardware or industrial applications

Support DL4J platform

In theory, DL4J is supported on any 64-bit platform that supports the JVM and runs Java V1.7 or later. DL4J uses ND4J to access a supported GPU. ND4J depends on other software such as CUDA and CuDNN.

In fact, commercial DL4J requires a production-grade Java platform. IBM Open Platform for Apache Hadoop and Apache Spark has completed the certification framework DL4J on PowerAI. Cloudera has also been completed DL4J certification on its Enterprise Data Hub CDH5, Hortonworks same also in its Data Platform \ completed certification on HDP2.4.

For more information on installing ND4J and other prerequisite software, check the ND4J Getting Started document.

Build DL4J from source

In other frameworks, it is sometimes more convenient to use a pre-built binary to install the framework. However, for DL4J, it is best to build and install DL4J from source code to ensure proper handling of multiple dependencies. The installation is a multi-step complex process suitable for production-level installations. Apache Maven V3.3.9 or later can manage builds and dependencies. For integrated development environments, you can use IntelliJ IDEA or Eclipse.

Experts recommend using the "uber-jar" method to build DL4J applications. This method supports the use of .rpm or .deb packages to distribute dependencies internally within "uber-jar" and to isolate deployment and development.

For more information on building applications using DL4J, read the Quick Start Guide.

DL4J on the Power Architecture

The DL4J team officially maintains DL4J for IBM Power® in the DL4J repository. Maven manages the build and installation process. The ND4J has two native platform backends for the Power Architecture: the first to run on the POWER8 CPU and the second to use the NVLink interconnect to run on the NVIDIA GPU.

The ND4J CPU backend nd4j-native-platform runs an optimized version of the OpenBLAS library. To speed things up, the ND4J CPU backend uses vector/scalar floating point units on the POWER8 processor.

ND4J GPU rear nd4j-cuda-8.0-platform may be run on a CUDA or cuDNN NVLink using the processor interconnect interface POWER8 NVIDIA GPU.

For more information on installing DL4J on the Power architecture, visit https://deeplearning4j.org/power.

Note: On POWER8 platforms, the preferred Java level is V8. The only Java 7 release tuned for POWER8 is Java 7.1 SR1 or later.

How does DL4J use hardware acceleration?

DL4J uses hardware acceleration on the platform-specific backends ND4J and ND4S, respectively. The ND4J and ND4S Java and Scala APIs are used to encapsulate BLAS libraries such as Jblas, Netlib-blas, and Jcublas.

ND4J has two levels of operation. Advanced operations include convolutions, Fast Fourier Transforms, various loss functions, transforms (eg, sigmoid transforms or tanh transforms), and reductions. BLAS performs low-level operations when invoked via the ND4J API. BLAS operations include vector addition, scalar multiplication, point multiplication, linear combination, and matrix multiplication.

ND4J runs on backends specific to the platform architecture. CPU backend with nd4j-native prefix, GPU backend with nd4j-cuda- The prefix, where the CUDA version may be 7.5 or 8.0, and so on. The ND4J API remains the same regardless of the back end.

Finally, ND4J implements a BLAS-specific data buffer for storing BLAS-processed arrays and raw data bytes. Depending on the back end, this storage abstraction layer has different implementations. The JVM communicates with the backend via JNI.

Conclusion

Deeplearning4j is a deep learning tool and library framework written specifically to take full advantage of the Java Virtual Machine. The DL4J framework is designed to deploy commercial deep learning algorithms on production-level servers. It has a distributed deep learning library written for Java and Scala, and has built-in integration with Hadoop and Spark. The DL4J runs on distributed CPUs and GPUs and provides both community and enterprise versions. Skymind, as its commercial support organization, provides professional services and support for enterprise editions.

POX-182MM

Power X (Qingdao) Energy Technology Co., Ltd. , https://www.solarpowerxx.com