only-brain

Crates.ioonly-brain
lib.rsonly-brain
version0.1.4
sourcesrc
created_at2023-12-04 00:32:49.283075
updated_at2023-12-13 00:01:38.914926
descriptionA simple Neural Network library, without the learning part.
homepage
repositoryhttps://github.com/IgorFroehner/only-brain
max_upload_size
id1057153
size22,343
Igor S. Froehner (IgorFroehner)

documentation

README

Only Brain

A very simple Neural Network library built in Rust with the objective to allow the user to create, manipulate and train a neural network directly. The user has direct access to weights and biases of the network, allowing they to manipulate the NN as wanted.

Usage

use no_brain::NeuralNetwork;
use nalgebra::dmatrix;
use nalgebra::dvector;

fn main() {
    let mut nn = NeuralNetwork::new(&vec![2, 2, 1]);

    nn.set_layer_weights(1, dmatrix![0.1, 0.2;
                                     0.3, 0.4]);
    nn.set_layer_biases(1, dvector![0.1, 0.2]);

    nn.set_layer_weights(2, dmatrix![0.9, 0.8]);
    nn.set_layer_biases(2, dvector![0.1]);

    let input = vec![0.5, 0.2];
    let output = nn.feed_forward(&input);

    println!("{:?}", output);
}
Commit count: 16

cargo fmt