MLP for CIFAR-10 (3072 β†’ 128 β†’ 10, RELU)

Model compared in Section 1.5 of SMAI Assignment 4 (Monsoon 2026), trained on the true labels (label noise p = 0). Ordinary MLP, no weight constraints.

architecture 3072 β†’ 128 β†’ 10 (fully connected), hidden activation RELU, output = 10 logits
parameters 394,634
training PyTorch, plain SGD, lr 0.01, batch size 64, grad. accumulation 1, 100 epochs, cross-entropy, float32, seed 11011
data CIFAR-10 train part (50,000 images) for training, test part (10,000) for testing
test accuracy 0.4694 (after the last epoch)

Files

  • weights.npz: W0, b0, W1, b1, ... with W{i} of shape (n_in, n_out), so z = h @ W + b.
  • preprocessing.npz: mean, std (3072 values each) of the training images after dividing by 255.
  • config.json: architecture, training settings and preprocessing.

Preprocessing and inference (NumPy)

import numpy as np
w, pre = np.load("weights.npz"), np.load("preprocessing.npz")
x = image.reshape(-1, 3072).astype(np.float64) / 255.0   # uint8 image(s) of shape (32, 32, 3), (H, W, C) order
h = (x - pre["mean"]) / pre["std"]
n_layers = len([k for k in w.files if k.startswith("W")])
for i in range(n_layers):
    h = h @ w[f"W{i}"] + w[f"b{i}"]
    if i < n_layers - 1:
        h = np.maximum(h, 0.0)   # RELU
logits = h
pred = logits.argmax(axis=1)
Downloads last month
17
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support

Dataset used to train dhr-m/smai-a4-mlp