Skip to content

JGynther/toy_nn

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

toy_nn

A naive neural network implementation from scratch in Rust for fun. Also includes a roughly equivalent Python implementation for testing purposes.

You can see an example of fitting a dense/linear NN to a sine wave in the main.rs file.

// Create a NN
let mut model = Sequential::new(MSE {});

model.add(Dense::new(2, 3));
model.add(ReLU::new());
model.add(Dense::new(3, 1));
// Predict
let pred = model.forward(&x);

// Backprop
let error = model.loss_fn.loss_prime(&pred, &y);
model.backward(&error, learning_rate);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published