A simple neural network implementation in Java built from scratch, designed to demonstrate the core mechanics of neural networks in an easy-to-understand way.
Perfect for learning how forward propagation and weight training works without heavy libraries.
This repository contains a basic feed-forward neural network built entirely in Java, with minimal dependencies.
Itβs a learning resource for developers and students who want to see, run, and modify a neural network without relying on frameworks like TensorFlow or DL4J.
β Written entirely in Java
β Feed-forward neural network
β Weight initialization and training logic
β No external ML libraries
β Easy to read and expand
- Java 8+
- Maven (optional, if using)
If the project uses Maven:
mvn compile
mvn exec:java -Dexec.mainClass="com.yourpackage.Main"javac -d out/ src/*.java
java -cp out/ MainThis neural network follows a simple process:
1. Inputs pass through layers
2. Weights and biases are applied
3. Activation functions transform values
4. Learning updates weights over iterations
Java-SimpleNeuralNetwork/
βββ src/ # Java source code
β βββ NeuralNetwork.java # Neural network core
β βββ Neuron.java # Neuron & activation helpers
β βββ Main.java # Example / entry point
βββ docs/ # Optional documentation
βββ examples/ # Example inputs / cases
βββ .gitignore
βββ pom.xml # (If using Maven)
βββ README.md