Zurück zum Ranking

deepjavalibrary/djl

Javadjl.ai

An Engine-Agnostic Deep Learning Framework in Java

deep-learningneural-networkaijavamxnetmachine-learningdeep-neural-networksmlautograddjlpytorchtensorflow
Sterne-Wachstum
Sterne
4.8k
Forks
752
Wochenwachstum
Issues
215
2k4k
Nov. 2019Jan. 2022Apr. 2024Juli 2026
ArtefakteMavengit clone https://github.com/deepjavalibrary/djl.git
README

DeepJavaLibrary

Release Docs Continuous Nightly Publish CodeQL

Deep Java Library (DJL)

Overview

Deep Java Library (DJL) is an open-source, high-level, engine-agnostic Java framework for deep learning. DJL is designed to be easy to get started with and simple to use for Java developers. DJL provides a native Java development experience and functions like any other regular Java library.

You don't have to be machine learning/deep learning expert to get started. You can use your existing Java expertise as an on-ramp to learn and use machine learning and deep learning. You can use your favorite IDE to build, train, and deploy your models. DJL makes it easy to integrate these models with your Java applications.

Because DJL is deep learning engine agnostic, you don't have to make a choice between engines when creating your projects. You can switch engines at any point. To ensure the best performance, DJL also provides automatic CPU/GPU choice based on hardware configuration.

DJL's ergonomic API interface is designed to guide you with best practices to accomplish deep learning tasks. The following pseudocode demonstrates running inference:

    // Assume user uses a pre-trained model from model zoo, they just need to load it
    Criteria<Image, Classifications> criteria =
            Criteria.builder()
                    .optApplication(Application.CV.OBJECT_DETECTION) // find object detection model
                    .setTypes(Image.class, Classifications.class)    // define input and output
                    .optFilter("backbone", "resnet50")               // choose network architecture
                    .build();

    Image img = ImageFactory.getInstance().fromUrl("http://...");    // read image
    try (ZooModel<Image, Classifications> model = criteria.loadModel();
         Predictor<Image, Classifications> predictor = model.newPredictor()) {
        Classifications result = predictor.predict(img);

        // get the classification and probability
        ...
    }

The following pseudocode demonstrates running training:

    // Construct your neural network with built-in blocks
    Block block = new Mlp(28 * 28, 10, new int[] {128, 64});

    Model model = Model.newInstance("mlp"); // Create an empty model
    model.setBlock(block);                  // set neural network to model

    // Get training and validation dataset (MNIST dataset)
    Dataset trainingSet = new Mnist.Builder().setUsage(Usage.TRAIN) ... .build();
    Dataset validateSet = new Mnist.Builder().setUsage(Usage.TEST) ... .build();

    // Setup training configurations, such as Initializer, Optimizer, Loss ...
    TrainingConfig config = setupTrainingConfig();
    Trainer trainer = model.newTrainer(config);
    /*
     * Configure input shape based on dataset to initialize the trainer.
     * 1st axis is batch axis, we can use 1 for initialization.
     * MNIST is 28x28 grayscale image and pre processed into 28 * 28 NDArray.
     */
    trainer.initialize(new Shape(1, 28 * 28));
    EasyTrain.fit(trainer, epoch, trainingSet, validateSet);

    // Save the model
    model.save(modelDir, "mlp");

    // Close the resources
    trainer.close();
    model.close();

Getting Started

Resources

Release Notes

Building From Source

To build from source, begin by checking out the code. Once you have checked out the code locally, you can build it as follows using Gradle:

# for Linux/macOS:
./gradlew build

# for Windows:
gradlew build

To increase build speed, you can use the following command to skip unit tests:

# for Linux/macOS:
./gradlew build -x test

# for Windows:
gradlew build -x test

Importing into eclipse

to import source project into eclipse

# for Linux/macOS:
./gradlew eclipse

# for Windows:
gradlew eclipse

in eclipse

file->import->gradle->existing gradle project

Note: please set your workspace text encoding setting to UTF-8

Community

You can read our guide to community forums, following DJL, issues, discussions, and RFCs to figure out the best way to share and find content from the DJL community.

Join our slack channel to get in touch with the development team, for questions and discussions.

Follow our X (formerly Twitter) to see updates about new content, features, and releases.

关注我们 知乎专栏 获取DJL最新的内容!

License

This project is licensed under the Apache-2.0 License.

Ähnliche Repositories
tensorflow/tensorflow

An Open Source Machine Learning Framework for Everyone

C++Apache License 2.0tensorflowmachine-learning
tensorflow.org
196.5k75.7k
AUTOMATIC1111/stable-diffusion-webui

Stable Diffusion web UI

PythonPyPIGNU Affero General Public License v3.0deep-learningdiffusion
164.3k30.4k
huggingface/transformers

🤗 Transformers: the model-definition framework for state-of-the-art machine learning models in text, vision, audio, and multimodal models, for both inference and training.

PythonPyPIApache License 2.0nlpnatural-language-processing
huggingface.co/transformers
162.8k34k
pytorch/pytorch

Tensors and Dynamic neural networks in Python with strong GPU acceleration

PythonPyPIOtherneural-networkautograd
pytorch.org
101.8k28.4k
rasbt/LLMs-from-scratch

Implement a ChatGPT-like LLM in PyTorch from scratch, step by step

Jupyter NotebookOthergptlarge-language-models
amzn.to/4fqvn0D
99.5k15.3k
opencv/opencv

Open Source Computer Vision Library

C++Apache License 2.0opencvc-plus-plus
opencv.org
90.1k56.9k
Developer-Y/cs-video-courses

List of Computer Science courses with video lectures.

computer-sciencealgorithms
82.6k11.4k
d2l-ai/d2l-zh

《动手学深度学习》:面向中文读者、能运行、可讨论。中英文版被70多个国家的500多所大学用于教学。

PythonPyPIApache License 2.0deep-learningbook
zh.d2l.ai
79.1k12.3k
dair-ai/Prompt-Engineering-Guide

🐙 Guides, papers, lessons, notebooks and resources for prompt engineering, context engineering, RAG, and AI Agents.

MDXMIT Licensedeep-learningprompt-engineering
promptingguide.ai
76.8k8.4k
labmlai/annotated_deep_learning_paper_implementations

🧑‍🏫 60+ Implementations/tutorials of deep learning papers with side-by-side notes 📝; including transformers (original, xl, switch, feedback, vit, ...), optimizers (adam, adabelief, sophia, ...), gans(cyclegan, stylegan2, ...), 🎮 reinforcement learning (ppo, dqn), capsnet, distillation, ... 🧠

PythonPyPIMIT Licensedeep-learningdeep-learning-tutorial
nn.labml.ai
67.2k6.7k
keras-team/keras

Deep Learning for humans

PythonPyPIApache License 2.0deep-learningtensorflow
keras.io
64.2k19.7k
CorentinJ/Real-Time-Voice-Cloning

Clone a voice in 5 seconds to generate arbitrary speech in real-time

PythonPyPIOtherdeep-learningpytorch
60k9.4k