File size: 818 Bytes
22afe27 5d1abe5 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
---
license: mit
---
## Introduction
MNIST_LeNet is a CNN model used for handwriting recognization.
This model is trained with traditional MNIST dataset, which is included in PyTorch as default.
As a result, it could achieve 99.5% accuracy among handwriting recognization tasks.
## Hands on
```python3
import torch
LeNet = torch.load('path/to/model/mnist_lenet.pt')
LeNet.eval()
# config preprocessor for your data
transform = ...
# load data
input_data = transform(open('path/to/your/data'))
# predict with our model
with torch.no_grad():
output = LeNet(input_data)
# explain results
prob = torch.nn.functional.softmax(output[0], dim=0)
...
```
## Reference
- [LeNet Paper: GradientBased Learning Applied to Document
Recognition(1998)](http://vision.stanford.edu/cs598_spring07/papers/Lecun98.pdf)
|