MNIST Classifier (PyTorch)

What this model does

This repository contains a simple feed-forward neural network trained to classify MNIST handwritten digits (0โ€“9).

Intended use

  • Educational example for saving, uploading, and reloading a PyTorch model using the Hugging Face Hub.
  • Simple baseline digit classification for MNIST-like inputs.

How to use (inference)

import torch

loaded = ClassifierHF.from_pretrained("foxnat/mnist-classifier-hf")
loaded.eval()

with torch.no_grad():
    logits = loaded(x)
    preds = torch.argmax(logits, dim=1)

Training data

MNIST handwritten digits loaded via torchvision in the tutorial notebook.

Evaluation

Test accuracy is printed in the notebook after training and after reloading from the Hub.

Limitations

  • This model is intended for teaching purposes only.
  • Performance depends on using the same preprocessing as training.
Downloads last month
12
Safetensors
Model size
567k params
Tensor type
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support