Skip to content
/ Meuron Public

A modular rust written library for training simple Neuronal Networks.

License

Notifications You must be signed in to change notification settings

NLion74/Meuron

Repository files navigation

Meuron

A modular rust written library for training simple Neuronal Networks.

Features

  • Modular layer system
  • Multiple activation functions (ReLU, Sigmoid, Softmax)
  • Multiple cost functions (MSE, CrossEntropy, BinaryCrossEntropy)
  • Easy to extend with custom layers and activations

Quick Start

Add to your Cargo.toml:

[dependencies]
meuron = "0.1"

Basic Example

use meuron::{NeuralNetwork, layer::DenseLayer, activation::Sigmoid, cost::MSE};
use ndarray::Array2;

fn main() {
    // Create a simple 2-layer network
    let layer1 = DenseLayer::new(784, 128, Sigmoid);
    let layer2 = DenseLayer::new(128, 10, Sigmoid);

    let mut nn = NeuralNetwork::new(
        vec![layer1, layer2],
        MSE,
    );

    // Train the network
    nn.train(&train_data, &train_labels, 0.01, 10, 32);

    // Save the model
    nn.save("model.bin").unwrap();

    // Load later
    let loaded_nn = NeuralNetwork::load("model.bin", MSE).unwrap();
}

Available Components

Activations

  • ReLU
  • Sigmoid
  • Softmax
  • Tanh

Cost Functions

  • MSE
  • CrossEntropy
  • BinaryCrossEntropy

Layers

  • DenseLayer

Examples

See the examples/ directory:

cargo run --example mnist --release

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

About

A modular rust written library for training simple Neuronal Networks.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages