A visually engaging implementation of a neural network solving the XOR problem, complete with real-time graphical visualization using the LÖVE2D framework.
- Interactive Neural Network Visualization
- Real-time rendering of network architecture
- Dynamic connection lines between layers
- Color-coded neurons (input/hidden/output)
- Multiple Activation Functions
- Sigmoid (default)
- ReLU
- Leaky ReLU
- Tanh
- Training Controls
- Adjustable learning rate
- Variable training speed (↑/↓ keys)
- Real-time error tracking
- Modular Architecture
- Separated neural network logic and rendering
- Easy-to-modify configuration
-
Install LÖVE Framework:
- Windows/macOS: Download installer
- Linux:
sudo apt install love
-
Clone Repository:
git clone https://github.com/VictorHLara/LuaNeuralNetwork.git cd LuaNeuralNetwork -
Run Project:
love .- Start training visualization
love .- Keyboard Controls:
↑ - Increase training speed ↓ - Decrease training speed
Modify main.lua to experiment:
local config = {
inputSize = 2,
hiddenSize = 4,
outputSize = 1,
learningRate = 0.3,
trainingDelay = 0.5,
activation = "leaky_relu", -- Try: sigmoid/relu/tanh
}