Simple neural network library for Rust.
cargo add rustunumic
If you have already added rustunumic, you can update to the latest version by using:
cargo update rustunumic
use rustunumic::Rustunumic;
fn main() {
// Returns a new neural network instance.
let mut rn = Rustunumic::<f32>::new();
// Dataset.
data_input = [0.27, 0.31];
data_target = [0.7];
// Training dataset.
let (num, loss) = rn.train(&data_input, &data_target);
print!("{num:?} {loss:?}");
}
The neuron bias, false or true (required field for a config).
hidden_layers
Array of the number of neurons in each hidden layers.
ActivationMode function mode (required field for a config).
Code | Activation | Description |
---|---|---|
0 | Linear | Linear/identity |
1 | ReLU | Rectified Linear Unit |
2 | LeakyReLU | Leaky Rectified Linear Unit |
3 | Sigmoid | Logistic, a.k.a. sigmoid or soft step |
4 | TanH | Hyperbolic Tangent |
The mode of calculation of the total error.
Code | Loss | Description |
---|---|---|
0 | MSE | Mean Squared Error |
1 | RMSE | Root Mean Squared Error |
2 | Arctan | Arctan Error |
3 | Avg | Average Error |
Minimum (sufficient) limit of the average of the error during training.
Learning coefficient (greater than 0.0 and less than or equal to 1.0).
More documentation is available at the rustunumic website.
You can find examples of neural networks in the example's directory.
Project at the initial stage.
See the latest commits.