File size: 640 Bytes
aa4ef04
f617b01
 
 
eda317f
da2d8b5
eda317f
da2d8b5
aa4ef04
f617b01
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
---

tags:
- image-classification
- pytorch
- mnist
license: apache-2.0
library_name: pytorch
pipeline_tag: image-classification
---


# MNIST Digit Classifier

A convolutional neural network trained on MNIST to classify digits 0-9.

## Usage

```python

from src.model import DigitClassifier

import torch



model = DigitClassifier()

model.load_state_dict(torch.load("model_weights.pth"))

model.eval()



# Preprocessing (same as training):

transform = transforms.Compose([

    transforms.Resize((28, 28)),

    transforms.Grayscale(),

    transforms.ToTensor(),

    transforms.Normalize((0.1307,), (0.3081,))

])

```