cifar10-mlp-384-128 (MLP, CIFAR-10, clean labels p = 0)
Architecture
- Input: 3072 (32x32x3 image, flattened, HWC order as loaded from
uoft-cs/cifar10) - Layers: 3072 -> 384 -> 128 -> 10 (raw logits; use softmax / CrossEntropyLoss outside the model)
- Parameters: 1,230,602 (layer 1 alone holds 1,179,648 weights, about 95.8% of the total)
- ReLU hidden activations, unconstrained weights.
- Initialisation: Hidden: N(0, 2/n_in); output: N(0, 1/n_in); biases 0.
Preprocessing (must be applied to inputs)
- Flatten each 32x32x3 uint8 image to a 3072-vector.
- Divide by 255 (float32).
- Standardise per feature:
(x - mean) / std, where mean/std are computed on the 50,000 CIFAR-10 training images only (std of 0 replaced by 1). The statistics are inpreprocessing_stats.safetensors(keysmean,std, each shape (3072,));preprocess.pyimplements the pipeline.
Training
- Data: official CIFAR-10 train (50,000) / test (10,000) split, true labels (p = 0)
- SGD, lr 0.05, no momentum, batch 64, 100 epochs, cross-entropy loss
- Seeds (roll-number based): torch init seed + 1, batch-shuffle generator seed + 2
Results (test set, final epoch)
- Test accuracy: 51.23% | Train accuracy: 98.69%
- Test loss: 6.2340 | Macro F1: 0.5125
Usage
import torch, numpy as np
from safetensors.torch import load_model
from modeling import StandardMLP as Net
from preprocess import preprocess
model = Net(); load_model(model, "model.safetensors"); model.eval()
logits = model(torch.tensor(preprocess(images_uint8))) # images_uint8: (N, 32, 32, 3)
Class order: 0=plane, 1=auto, 2=bird, 3=cat, 4=deer, 5=dog, 6=frog, 7=horse, 8=ship, 9=truck.