Views
No views yet

| metric | value |
|---|---|
| validation accuracy | 99.3600% ± 0.0817 pp |
| validation loss | 0.15172 ± 0.00235 |
| test accuracy | 99.4470% ± 0.0195 pp |
| test loss | 0.14746 ± 0.00034 |
| test errors | 55.3 ± 1.95 / 10000 |
xa56lubb.102430.20.0010.00010.02512gsuy1ifxxa56lubbmodel.onnx for code-independent inference.images[batch, 1, 28, 28]float32logits[batch, 10]28 x 28.[0, 1].0.1307 and standard deviation 0.3081.[batch, 1, 28, 28].pip install huggingface_hub onnxruntime pillow numpy1import numpy as np
2import onnxruntime as ort
3from huggingface_hub import hf_hub_download
4from PIL import Image
5
6LABELS = {
7 0: "0",
8 1: "1",
9 2: "2",
10 3: "3",
11 4: "4",
12 5: "5",
13 6: "6",
14 7: "7",
15 8: "8",
16 9: "9",
17}
18
19model_path = hf_hub_download(
20 repo_id="tsilva/mnist-classifier-mlp",
21 filename="model.onnx",
22)
23
24image = Image.open("example.png").convert("L").resize((28, 28))
25x = np.asarray(image, dtype=np.float32) / 255.0
26x = (x - 0.1307) / 0.3081
27x = x[None, None, :, :].astype(np.float32)
28
29session = ort.InferenceSession(model_path, providers=["CPUExecutionProvider"])
30logits = session.run(["logits"], {"images": x})[0]
31prediction = int(logits.argmax(axis=1)[0])
32
33print(prediction, LABELS[prediction])| id | label |
|---|---|
| 0 | 0 |
| 1 | 1 |
| 2 | 2 |
| 3 | 3 |
| 4 | 4 |
| 5 | 5 |
| 6 | 6 |
| 7 | 7 |
| 8 | 8 |
| 9 | 9 |
model.onnx: ONNX export of the validation-selected checkpoint. Prefer this file for portable inference.model.ckpt: PyTorch Lightning checkpoint for the same model. This is code-dependent and mainly useful for PyTorch-based inspection or continued experimentation.config.yaml: resolved Hydra training config.metrics.csv: training metrics from the uploaded checkpoint run.metadata.json: compact metadata for inference and provenance.