A lightweight C++ project implementing standalone single-layer neural models for:
- Binary classification
- Nonlinear regression
The project includes dataset generation, training visualization, and an interactive UI built with ImGui.
This project focuses on implementing neural models from scratch without external ML frameworks.
It is designed to clearly demonstrate the behavioral differences between classification and regression while providing real-time visualization of training dynamics.
Two independent neuron implementations are provided:
ClNeuron– binary classificationRegNeuron– regression
Each model has its own data structures and training logic.
- Linear binary classifier
- Two bias strategies:
- Explicit bias term (
w0) - Threshold-based decision
- Explicit bias term (
- Custom dataset loading
- Interactive visualization of decision boundary
- Single-layer regression neuron
- Nonlinear target functions (e.g., parabola-based datasets)
- Optional noise injection in dataset generation
- Real-time prediction curve rendering
- Built with ImGui
- Toolbar with:
- Model selector (combo box)
- Training controls
- Dataset loading
- Interactive canvas:
- Zoom
- Mouse panning
- Data point rendering
- Model output rendering
- C++20 or newer
- CMake
- ImGui
- X11 (Linux)
mkdir build
cmake -S . -B build
cmake --build buildx y label
Example:
0.5 1.2 1
-0.3 0.8 0
x y
Example:
-2.0 4.1
0.5 0.3