Fast, Scientific and Numerical Computing for the JVM (NDArrays)
Java Shell
Latest commit 05d7605 Jan 23, 2017 @agibsonccc agibsonccc committed on GitHub Merge pull request #1604 from wobu/backend_priority_fix
fixed #1601 backend priority loading when using reflection
Failed to load latest commit information.
nd4j-backends Update version of JavaCPP to 1.3.2-SNAPSHOT (pull #1602) Jan 23, 2017
nd4j-buffer Update to version 0.7.3-SNAPSHOT Dec 24, 2016
nd4j-bytebuddy Update to version 0.7.3-SNAPSHOT Dec 24, 2016
nd4j-common toInts - moved from deeplearning4j/deeplearning4j#2562 Dec 28, 2016
nd4j-context fixed #1601 backend priority loading when using reflection Jan 23, 2017
nd4j-instrumentation Update to version 0.7.3-SNAPSHOT Dec 24, 2016
nd4j-jdbc Update to version 0.7.3-SNAPSHOT Dec 24, 2016
nd4j-parameter-server-parent Update to version 0.7.3-SNAPSHOT Dec 24, 2016
nd4j-perf Update to version 0.7.3-SNAPSHOT Dec 24, 2016
nd4j-serde Remove commas from between numbers so json parser parses correctly Jan 4, 2017
nd4j-shade op.x nullcheck Dec 27, 2016
.gitignore Update PCA to use SVD (pull #1527) Dec 19, 2016
DskipTests add new module Sep 27, 2016
LICENSE Initial commit Aug 31, 2014 canova -> datavec Dec 9, 2016 Changes to support Raspberry Pi (pull #1455) Nov 26, 2016
VERSION Add explicit versioninig. Jan 7, 2016 Minor additional tweak to scala build Jul 28, 2016 Add and rearrange artifacts to support CUDA 8.0 Sep 14, 2016 add test for base64 testing of arrays (#1165) Jul 31, 2016 Update build script for release Nov 20, 2016
pom.xml Update version of JavaCPP to 1.3.2-SNAPSHOT (pull #1602) Jan 23, 2017 tests should be reproducible Feb 11, 2016 added sync_upstream Mar 9, 2015

ND4J: Scientific Computing on the JVM

Join the chat at Maven Central Javadoc

ND4J is an Apache2 Licensed open-sourced scientific computing library for the JVM. It is meant to be used in production environments rather than as a research tool, which means routines are designed to run fast with minimum RAM requirements.

Please search for the latest version on

Or use the versions displayed in:

Main Features

  • Versatile n-dimensional array object
  • Multiplatform functionality including GPUs
  • Linear algebra and signal processing functions


  • Supports GPUs via with the CUDA backend nd4j-cuda-7.5 and Native via nd4j-native.
  • All of this is wrapped in a unifying interface.
  • The API mimics the semantics of Numpy, Matlab and scikit-learn.


Several of these modules are different backend options for ND4J (including GPUs).

  • api = core
  • instrumentation
  • jdbc = Java Database Connectivity
  • jocl-parent = Java bindings for OpenCL
  • scala-api = API for Scala users
  • scala-notebook = Integration with Scala Notebook

Building Specific Modules

It is possible to build the project without the native bindings. This can be done by specic targeting of the project to build.

mvn clean package test -pl :nd4j-api


Documentation is available at Access the JavaDocs for more detail.


To install ND4J, there are a couple of approaches, and more information can be found on the ND4J website.

Install from Maven Central

  1. Search for nd4j in the Maven Central Repository to find the available nd4j jars.
  2. Include the appropriate dependency in your pom.xml.

Clone from the GitHub Repo

ND4J is actively developed. You can clone the repository, compile it, and reference it in your project.

Clone the repository:

$ git clone

Compile the project:

$ cd nd4j
$ mvn clean install -DskipTests=true -Dmaven.javadoc.skip=true

Add the local compiled file dependency (choose the module for your backend) to your pom.xml file:


Yum Install / Load RPM (Fedora or CentOS)

Create a yum repo and run yum install to load the Red Hat Package Management (RPM) files. First create the repo file to setup the configuration locally.

$ sudo vi /etc/yum.repos.d/dl4j.repo

Add the following to the dl4j.repo file:





Then run the following command on the dl4j repo packages to install them on your machine:

$ sudo yum install [package name] -y
$ sudo yum install nd4j-cli -y # for example

Note, be sure to install the nd4j modules you need first, especially the backend and then install DataVec & dl4j.


Run the following command to execute all tests at once.

mvn test

Or, run the following command to execute TestSuite with only specified backend e.g. nd4j-cuda-7.5 on GPU.

mvn test -pl nd4j-XXX
  • nd4j-cuda-7.5
  • nd4j-native

Or, run the following command to execute only specified tests in TestSuite with only specified backend.

 mvn test -pl nd4j-XXX -Dorg.nd4j.linalg.tests.classestorun=org.nd4j.linalg.YYY -Dorg.nd4j.linalg.tests.methods=ZZZ


  1. Check for open issues, or open a new issue to start a discussion around a feature idea or a bug.
  2. If you feel uncomfortable or uncertain about an issue or your changes, feel free to contact us on Gitter using the link above.
  3. Fork the repository on GitHub to start making your changes to the master branch (or branch off of it).
  4. Write a test, which shows that the bug was fixed or that the feature works as expected.
  5. Send a pull request, and bug us on Gitter until it gets merged and published.