Instructions to use dacorvo/mnist-mlp with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- Transformers
How to use dacorvo/mnist-mlp with Transformers:
# Use a pipeline as a high-level helper from transformers import pipeline pipe = pipeline("image-classification", model="dacorvo/mnist-mlp", trust_remote_code=True) pipe("https://huggingface.co/datasets/huggingface/documentation-images/resolve/main/hub/parrots.png")# Load model directly from transformers import AutoModel model = AutoModel.from_pretrained("dacorvo/mnist-mlp", trust_remote_code=True, dtype="auto") - Notebooks
- Google Colab
- Kaggle
Model Card for MNIST-MLP
This is a simple MLP trained on the MNIST dataset.
Its primary use is to be a very simple reference model to test quantization.
Inputs preprocessing
The MNIST images must be normalized and flattened as follows:
from torchvision import datasets, transforms
transform=transforms.Compose([
transforms.ToTensor(),
transforms.Normalize((0.1307,), (0.3081,)),
transforms.Lambda(lambda x: torch.flatten(x)),
])
test_set = datasets.MNIST('../data', train=False, download=True,
transform=transform)
- Downloads last month
- 107