Skip to content

teratron/rustunumic

Repository files navigation

Rustunumic

Crates.io License (version) docs.rs (with version) Crates.io Total Downloads Crates.io Version fork with dotenv-vault


Description

Simple neural network library for Rust.

Visuals

Installation

cargo add rustunumic

If you have already added rustunumic, you can update to the latest version by using:

cargo update rustunumic

Usage

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:?}");
}

Documentation

Properties of Neural Network

bias

The neuron bias, false or true (required field for a config).

hidden_layers

Array of the number of neurons in each hidden layers.

activation_mode

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

loss_mode

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

loss_limit

Minimum (sufficient) limit of the average of the error during training.

rate

Learning coefficient (greater than 0.0 and less than or equal to 1.0).

More documentation is available at the rustunumic website.

Examples

You can find examples of neural networks in the example's directory.

Support

Roadmap

Contributing

Authors and acknowledgment

License

MIT License.

Project status

Project at the initial stage.

See the latest commits.


About

Simple neural network library for Rust.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published