Skip to content

DarkMatter-999/NeuralNetworks-Rust

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Neural Networks in Rust

This is a Neural Networks implementation in pure Rust. The only libraries used are -

  • rand - for generating random weights
  • libm - for for various math functions

Usage

// Make a network
let network: Vec<Box<dyn Learn>> = vec![
    Box::new(DenseLayer::new(2, 3)),
    Box::new(Sigmoid::new(3, 3)),
    Box::new(DenseLayer::new(3, 1)),
    Box::new(Sigmoid::new(1, 1)),
];

// Add inputs
let xtrain = vec2d![[....]];
let ytrain = vec2d![[....]];

// Train
let trained_network = train(network, 1000, &xtrain, &ytrain, 0.1);

// Predict
let output = predict(&trained_network, &<xtest>);

TODO:

Add convolution and other activation functions

Releases

No releases published

Packages

No packages published

Languages