fnn
A simple Feedforward Neural Network library for Rust
Features
- First class support for
no_stdenvironments - Simplicity
- Deterministic
- It works
Usage
To create a new neural network you can use the following. This creates a network that takes two inputs, has two hidden neurons and gives one output.
let mut nn = new;
Then given some training data like this:
let training_data = ;
You can train the network a few times:
for _ in 0..50_000
Then get a prediction:
let output = nn.forward;
The full example can produce decently accurate results with these parameters:
Input: , Output: 0.015919467, Expected: 0, Accuracy: 98.40805%
Input: , Output: 0.9832184, Expected: 1, Accuracy: 98.32184%
Input: , Output: 0.98321366, Expected: 1, Accuracy: 98.321365%
Input: , Output: 0.020730482, Expected: 0, Accuracy: 97.92695%