deeplearning4j/deeplearning4j-examples

Deeplearning4j Examples (DL4J, DL4J Spark, DataVec)

What this repo is

deeplearning4j‑examples is a collection of ready‑to‑run Java programs that show how to use the Eclipse Deeplearning4J (DL4J) ecosystem. The examples are grouped into small Maven projects, each focusing on a particular part of the stack – high‑level neural‑network APIs, data‑pipeline utilities, distributed training on Spark, GPU‑accelerated training, the lower‑level SameDiff automatic‑differentiation library, reinforcement‑learning (RL4J), and even an Android demo.

Who it’s for

  • Java developers who want to dip their toes into deep learning without switching languages.
  • Students or hobbyists looking for concrete, end‑to‑end code that goes from raw data to a trained model.
  • Practitioners needing reference code for advanced scenarios such as Spark‑based distributed training or GPU data‑parallelism.

What you’ll find inside

Sub‑folder Focus Typical content
dl4j-examples High‑level DL4J API Build and train multilayer perceptrons, CNNs, RNNs, etc., starting from raw data.
tensorflow-keras-import-examples Model import Load Keras .h5 or TensorFlow frozen .pb models into DL4J, then fine‑tune or run inference.
dl4j-distributed-training-examples Spark integration Show how to run training, inference, and evaluation across a Spark cluster using DL4J’s hybrid async‑SGD.
cuda-specific-examples Multi‑GPU training Demonstrate data‑parallel training on one or more CUDA GPUs for speed‑up.
samediff-examples Low‑level graph API Build computation graphs with SameDiff (DL4J’s analogue of TensorFlow’s graph mode).
data-pipeline-examples ETL with DataVec Load, split, and preprocess images, CSVs, video, etc., into reproducible pipelines.
nd4j-ndarray-examples NDArray manipulation Show NumPy‑like operations using ND4J’s INDArray class.
rl4j-examples Reinforcement learning Simple RL agents built with the RL4J library.
android-examples Mobile deployment A minimal Android app that runs a DL4J model on‑device.

Each sub‑project contains a README that lists the individual example classes and suggests an order for exploration (quick‑start first, then advanced). All examples are Maven‑based; a template pom.xml is provided for users who want to start a fresh project.

How to get started

  1. Clone the repo and pick the sub‑project that matches your interest.
  2. Build with Maven (mvn clean compile exec:java or use your IDE). The README points to the exact class to run.
  3. Run the code – most examples will download a small public dataset, preprocess it, train a model, and print basic metrics.
  4. Experiment – modify hyper‑parameters, swap datasets, or replace a layer to see how the results change.

Where to get help

  • The official DL4J community forum: https://community.konstitut.ai
  • GitHub issues for this repo (though the maintainers note they don’t monitor them frequently).
  • The broader DL4J documentation site for deeper dives into each library component.

Why it matters

DL4J is the most mature deep‑learning framework that runs natively on the JVM. For organizations that already have Java/Scala codebases, or for developers who prefer Java’s tooling (Maven/Gradle, IDE support, static typing), this repo provides the practical “how‑to” material needed to start building production‑grade AI models without leaving the Java ecosystem.


All details above are taken directly from the repository’s README; no additional features have been inferred.

Related

  • Project
  • Project
  • Project
  • Project
  • Project