Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nathanielsimard/numpy-mnist-classifier
Feed forward neural network using Numpy for MNIST classification.
https://github.com/nathanielsimard/numpy-mnist-classifier
deep-learning machine-learning mnist mnist-classification mnist-classifier numpy
Last synced: 21 days ago
JSON representation
Feed forward neural network using Numpy for MNIST classification.
- Host: GitHub
- URL: https://github.com/nathanielsimard/numpy-mnist-classifier
- Owner: nathanielsimard
- Created: 2019-01-11T00:20:49.000Z (almost 6 years ago)
- Default Branch: master
- Last Pushed: 2019-02-01T01:14:14.000Z (almost 6 years ago)
- Last Synced: 2024-12-05T17:47:04.432Z (about 1 month ago)
- Topics: deep-learning, machine-learning, mnist, mnist-classification, mnist-classifier, numpy
- Language: Python
- Homepage:
- Size: 490 KB
- Stars: 1
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Numpy Mnist Classifier
This project was done for learning purpose.
The goal was to implement a deep neural network to do supervised learning.
The MNIST data set was used due to its small size, making the learning process fast enough on a personal laptop.To try the project you first need to install the dependencies, note that `python3` is required.
```bash
pip install -r requirements/basic.txt
```## Usage
It only takes a small amount of code to test some models :
```python
from classifier import nn, training
from data import mnist# The MNIST data set will be automatically downloaded and cached.
training_data, validation_data, test_data = mnist.load()# Create a Neural Network with one hidden layer.
model = nn.NeuralNetwork([784, 30, 10], learning_rate=0.02, batch_size=50)# Train the model with early stopping regularization.
model_training = training.EarlyStoppingRegularization(model,
training_data,
validation_data,
test_data,
max_steps_without_progression=2)
model_training.train()# It is possible to save the result which serializes the model and create a report.
result.save('models/mnist-example')# It is possible to load the trained model for futur uses.
model_trained = nn.load('models/mnist-example/model.pkl)
```## Report Example
## Model
- Layers : [784, 30, 10]
- Activation : sigmoid
- Learning Rate : 0.02
- Batch Size : 50## Training
- Method : early stopping regularization
- Epochs : 69## Data
Size :
- Training : 50000
- Test : 10000
- Validation : 10000### Sample
![graph](./assets/sample.png)
## Accuracy and Loss
| | Training | Test |
|---|---|---|
| Accuracy | 97.392% | 95.430% |
| Loss | 0.046 | 0.081 |![graph](./assets/result.png)