Rust NN
A small feed-forward neural network in Rust that learns XOR, rewritten from a C++ implementation to explore ownership, traits, and typed layers.
Overview
A Rust rewrite of cpp_ml — a small feed-forward network that learns the XOR function from scratch.
The project was a way to practice Rust while rebuilding the core pieces of a neural network: tensors, layers, activations, loss, and training.
What It Does
An XOR example trains for 10,000 epochs at learning rate 0.05 and checks that mean squared error falls below 0.001 with predictions close to the targets.
Implementation Notes
- Tensors — owned vectors with indexing, arithmetic, and display
- Layers — trait-based design with
Box<dyn Layer>for the network - Linear / ReLU — dense layers and activations with backprop support
- Loss — mean squared error for the training loop