Rustml

Rustml is a library for doing machine learning in Rust.

The documentation of the project with a descprition of the modules can be found here.

Features

Prerequisites

sudo apt-get install libblas-dev libopencv-highgui-dev

Using rustml from scratch - example matrix multplication

Create a new project with cargo:

bash cargo new example --bin

A new directory example is created. Change into this directory and add the following lines Cargo.toml: [dependencies.rustml] git = "https://github.com/daniel-e/rustml/"

or the following dependency: [dependencies] rustml = "*"

Edit the file main.rs in the src directory.

```rust

[macro_use] extern crate rustml;

use rustml::*;

fn main() { let a = mat![ 1.0f32, 2.0; 3.0, 4.0; 5.0, 6.0 ]; let b = mat![ 5.0, 7.0; 6.0, 2.0 ]; let c = (a * b).unwrap();

println!("{}", c);

} ```

Now, in the example directory run the example with cargo run.

Other examples

You can find other examples in the directory examples. Each example can be executed with cargo run --example <example name> where <example name> is one of the following:

Rustml datasets package

The rustml dataset package needs to be installed separately. The package currently contains the MNIST database of handwritten digits and videos for the examples. Download the following script which will download and install the package in your home in the directory ~/.rustml/.

```bash

download the install script

wget -q https://raw.githubusercontent.com/daniel-e/rustml/master/dldatasets.sh chmod +x dldatasets.sh

download the datasets and install them into ~/.rustml/

./dl_datasets.sh ```