| Train | Test |
|---|---|
![]() |
![]() |
This project is a simple XOR neural network written in Rust. It trains a neural network to solve an XOR problem and uses the trained model to make predictions.
Model: A structure representing a neural network model, which contains multiple layers, each representing a part of the neural network. Model provides methods to train, predict, calculate loss, and record results.
Layer: A trait representing each layer of the neural network. In this project, we implement layers such as Dense, ReLU, and Sigmoid.
generate_xor_data: A function to generate XOR data. This function generates training data and test data of a given size.
cargo build
cargo runconda create -n ml python=3.11
conda activate ml
pip install matplotlib
python xor_viewer.pyThe project writes the results generated during the training process to the out/train and out/test directories. Therefore, you should back up the contents of those directories if you want to preserve the previous results before running the program.

