Skip to content
A git repository containing an MLP MNist example using DL4J in Java
Java Shell Dockerfile
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

MLPMnist-dl4j-example: MLPMNist Single Layer

MLPMNist using DL4J License

This repo is a result of the blog post How to do Deep Learning for Java | Original post. Please refer to the post before considering using this repo to understand better on how to use the different aspects of it.

Previous home of the project:

Open built-in Terminal from the Android Studio or IntelliJ IDEA. If you prefer, use the terminal app on your computer. In the terminal window, cd to the project root directory MLPMnist-dl4j-example if not already in. (you can use IDE's run-configuration green run button, if you like.)

Build app

mvn package -Djavacpp.platform=linux-x86_64
mvn package -Djavacpp.platform=macos-x86_64
mvn package -Djavacpp.platform=windows-x86_64

Build app for the docker image

Build docker image


Push to docker hub


Run app local

./ --action train --output-dir /path/to/model/creation/folder

followed by

./ --action evaluate --output-dir /path/to/model/folder

Model file created and seeked for in the respective cases, is called mlpmnist-single-layer.pb.

Run app in docker container


At the prompt in the container, do the same as mentioned in section Run app local.


This example has been inspired by the MLPMNist example example from DL4J. Credits to the original authors of this example on,


Original authors of this DL4J example project remain the license holders of the work, although the original work has been modified to a good extent, and the Apache 2.0 License is cited for all those file/files in the matter (see License.txt in the root of the project). Exception to the above: four bash scripts have been authored by Mani Sarkar and have been cited under the Apache 2.0 license.


Return to Awesome AI/ML/DL

You can’t perform that action at this time.