This project is a simple implementation of a neural network in Rust, designed to refresh my Rust skills and explore neural network concepts. The network has been implemented as an XOR gate to demonstrate basic functionality.
The primary focus of this project is to provide a foundational neural network structure while preparing for more advanced work, such as enabling GPU-powered machine learning computations using CUDA. The long-term goal is to bring GPU-enabled ML compute to the Internet Computer Protocol (ICP) blockchain.
- Neural Network Basics: A simple feedforward neural network that performs binary classification.
- XOR Gate Example: Trained to simulate an XOR gate, a classic problem that showcases the power of neural networks for non-linear classification.
- Rust Implementation: Fully written in Rust, leveraging the language's performance and safety benefits.
The immediate next step for this project is to integrate CUDA for GPU acceleration, enabling more complex and faster computations. The end goal is to bring GPU-enabled ML computation to the ICP chain.
The main logic is located in the main.rs file, which contains the neural network implementation and the XOR gate demonstration.
src/lib/matrix.rs: Contains Matrix class and code for all matrix operationssrc/lib/networks.rs: Contains Network class and code for backward and forward propogation.src/main.rs: Implementation of XOR gate example.
To run the XOR gate example and see the neural network in action, follow these steps:
- Clone the repository:
git clone https://github.com/DAKSHKT9/rust-nn.git
- Go to derectory:
cd rust-nn - Run using cargo:
cargo run