A rust neural network library, focusing on ease of use and performance.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Shad Amethyst b8c654ebb1
🎨 Run clippy on the project :)
12 months ago
examples 🎨 Introduce builder pattern for NeuraBatchedTrainer 1 year ago
src 🎨 Run clippy on the project :) 12 months ago
tests 🎨 Introduce builder pattern for NeuraBatchedTrainer 1 year ago
.gitignore ♻️ Implement and transition to NeuraMatrix and NeuraVector, to prevent stack overflows 1 year ago
Cargo.toml Working NeuraGraph construction 1 year ago
README.md 🎨 Introduce builder pattern for NeuraBatchedTrainer 1 year ago

README.md

NeurAmethyst

A neural network library written in Rust and for Rust, that focuses on flexibility and ease of use.

use neuramethyst::prelude::*;
use neuramethyst::derivable::loss::CrossEntropy;

// Create the network
let network = neura_sequential![
    neura_layer!("dense", 100),
    neura_layer!("dropout", 0.5),
    neura_layer!("dense", 40),
    neura_layer!("dropout", 0.5),
    neura_layer!("dense", 10),
    neura_layer!("softmax"),
];

// Assemble the network together, allowing layers to infer the shape of the input data
let mut network = network.construct(NeuraShape::Vector(100)).unwrap();

// Train the network
let trainer = NeuraBatchedTrainer::new()
    .learning_rate(0.03)
    .batch_size(128)
    .epochs(20, 50000); // number of epochs and size of the training set

trainer.train(
    &NeuraBackprop::new(CrossEntropy),
    &mut network,
    input_data(),
    test_data(),
);