https://github.com/mauri870/rust-fann-mnist
MNIST trained in rust using the fann library
https://github.com/mauri870/rust-fann-mnist
fann mnist neural-network rust
Last synced: about 1 month ago
JSON representation
MNIST trained in rust using the fann library
- Host: GitHub
- URL: https://github.com/mauri870/rust-fann-mnist
- Owner: mauri870
- Created: 2019-01-19T19:20:52.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2023-07-08T16:53:06.000Z (almost 2 years ago)
- Last Synced: 2023-08-01T16:51:26.219Z (almost 2 years ago)
- Topics: fann, mnist, neural-network, rust
- Language: Rust
- Size: 5.86 KB
- Stars: 6
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## RUST FANN MNIST
MNIST trained in rust using the [FANN](http://leenissen.dk/fann/wp/) library.
## Installation
```bash
yay -S fann
# or
# sudo apt install libfann-dev libfann2
git clone https://github.com/mauri870/rust-fann-mnist
cd rust-fann-mnist
```## Usage
### Download the dataset and generate FANN files
First you need to download the mnist dataset, for that run the following commands:
```bash
mkdir -p data
NAMES="train-images-idx3-ubyte train-labels-idx1-ubyte t10k-images-idx3-ubyte t10k-labels-idx1-ubyte"
for n in $NAMES; do
echo "Downloading $n..."
wget -qO- http://yann.lecun.com/exdb/mnist/$n.gz | gunzip -c > data/$n
done
```Next generate the train/test and validation files for FANN:
```bash
cargo run --bin preprocess --release
```### Train
```bash
cargo run --bin train --release
```Since FANN rely only on cpu computations, you can expect a training time of ~40 minutes on an octa core processor.
### Test
```bash
cargo run --bin test --release
```