This document is the API specification for the Deep Java Library (DJL).

The key design goal for the DJL is to simplify the use of deep learning for Java developers. Developers don't need to be machine learning/deep learning experts to get started. They can start with their existing Java expertise as a foundation to learn and use ML/DL. Developers can use their favorite IDE to build, train, and deploy their models. They can also easily integrate these models with their Java applications. They don't have to compromise on model performance, scale, or choice of GPU vs. CPUs.

DJL is deep learning engine agnostic. Developers don't have to make a choice between engines when they start their project. They can switch to a different engine at any time.

DJL provides a native Java development experience and functions just like any other regular Java library would. DJL's ergonomic API interface is designed to guide developers with best practices to accomplish deep learning tasks.

The following is an example of how to write inference code:

    // Assume user has a pre-trained already, they just need load it
    Model model = Model.load(modelDir, modelName);

    // User can implement Translator interface, read Translator for detail.
    Translator translator = new MyTranslator();

    // Next user need create a Predictor, and use Predictor.predict()
    // to get prediction.
    try (Predictor<Image, DetectedObjects> predictor = model.newPredictor(translator)) {
        DetectedObjects result = predictor.predict(img);

More tutorials, documents, and examples can be on our GitHub repository.

Package Description
Contains top level, engine-agnostic classes for both inference and training.
Contains classes responsible for loading a deep learning engine.
Contains classes to implement inference tasks.
Contains classes to collect metrics information.
Contains utility classes for each of the predefined modalities.
Contains utility classes for computer vision tasks and image processing.
Contains output types used in various computer vision applications.
Contains Transforms for working with Images.
Contains translators used for computer vision applications.
Contains wrappers to for multiple input formats to a BaseImageTranslator.
Contains utility classes for image manipulation.
Contains utility classes for natural language processing tasks.
Contains classes that deal with BERT for natural language pre-processing tasks.
Contains classes that deal with word embeddings for natural language pre-processing tasks.
Contains utility classes for natural language pre-processing tasks.
Contains utility classes for question and answer processing.
Contains utility classes for each of the predefined translator.
Contains utility classes for reinforcement learning.
Contains agents to learn using reinforcement learning.
Contains environments to train reinforcement learning in.
Contains classes and interfaces that define an n-dimensional array.
Contains classes that help access NDArray's indices.
Contains classes that represent an index element in a NDArray's indices.
Contains classes that represent simplified representations of an NDArray's indices.
Contains classes that define n-dimensional array data types.
Contains classes to construct neural networks.
Contains classes that define convolutional operations extending Convolution and Deconvolution.
Contains classes that define simple neural network operations.
Contains classes that define normalizing neural network operations.
Contains pooling neural network operations in Pool and helpers for it.
Contains classes for recurrent neural network operations.
Contains blocks for transformer models.
Contains a Maven-based Repository format for creating repositories of artifacts such as datasets and model zoos.
Contains classes for working with model zoo repositories.
Contains classes and implementations to train a neural network.
Contains classes to download and prepare training and testing data.
Contains classes for evaluating the effectiveness of models.
Contains utilities to train, describe, and manipulate Hyperparameters.
Contains classes to optimize Hyperparameters.
Contains different types of Hyperparameters.
Contains classes for initializing a Block's Parameters.
Contains classes providing functionality during training through TrainingListener.
Contains classes for measuring the Loss of a model.
Contains classes for optimizing a neural network Block.
Contains classes for having a gradually changing hyper-parameter.
Contains utilities to use during training.
Contains classes and interfaces that translate between java objects and NDArrays.