MNIST Read

Reads generic data and label files in the MNIST file format for Rust.

As simple as that.

```rust // Raw format let trainlabels: Vec = mnistread::readlabels("train-labels.idx1-ubyte"); let traindata: Vec = mnistread::readdata("train-images.idx3-ubyte");

// Ndarray (Maths lib) let usizelabels:Vec = trainlabels.intoiter().map(|l|l as usize).collect(); let mut arraylabels:ndarray::Array2 = ndarray::Array::fromshapevec((10000, 1), usizelabels).expect("Bad labels");

let f32data:Vec = traindata.intoiter().map(|d|d as f32 / 255f32).collect(); let mut arraydata:ndarray::Array2 = ndarray::Array::fromshapevec((10000, 28*28), f32_data).expect("Bad data");

// Cogent (Neural network library) let mut net = cogent::NeuralNetwork::new(784,&[ cogent::Layer::Dense(1000, cogent::Activation::ReLU), cogent::Layer::Dropout(0.2), cogent::Layer::Dense(500, cogent::Activation::ReLU), cogent::Layer::Dropout(0.2), cogent::Layer::Dense(10, cogent::Activation::Softmax) ]) net.train(&mut arraydata, &mut arraylabels).go() ```