|
Download README.md from Chervith-Reddy/smai-a4-iocnn: direct link, hf CLI and curl.
- Browser
- Download file 1.44 kB
-
https://huggingface.co/Chervith-Reddy/smai-a4-iocnn/resolve/main/README.md
- Command line
-
hf download hf://Chervith-Reddy/smai-a4-iocnn/README.md
-
curl -L -o README.md https://huggingface.co/Chervith-Reddy/smai-a4-iocnn/resolve/main/README.md
1.44 kB
metadata
library_name: numpy
tags:
- image-classification
- cifar10
datasets:
- uoft-cs/cifar10
CIFAR-10 IOC-NN (3072-128-10)
An input-output convex neural network (IOC-NN) for CIFAR-10 on raw pixels: ELU hidden activation and non-negative weights in every layer after the first, so every logit is a convex function of the input.
- Architecture: 3072-128-10 (394,634 parameters); hidden activation
elu, Identity output layer (logits). - Trained on the 50,000 CIFAR-10 training images with their true labels for 100 epochs: plain SGD, learning rate 0.01, batch size 64, cross-entropy loss, seed 1076.
- CIFAR-10 test accuracy (10,000 images): 0.4805; final training accuracy 0.8167.
Files
weights.npz:W0, b0, W1, b1(float64); layericomputesh @ W_i + b_iwithW_iof shape (n_in, n_out).preprocessing.npz:meanandstd(3072 values each) of the training pixels after dividing by 255.config.json: architecture, preprocessing, training settings and results.
Use
import numpy as np
w, prep = np.load("weights.npz"), np.load("preprocessing.npz")
x = (images.reshape(len(images), 3072) / 255.0 - prep["mean"]) / prep["std"] # images: uint8 (n, 32, 32, 3)
h = np.where((z := x @ w["W0"] + w["b0"]) > 0, z, np.expm1(np.minimum(z, 0.0)))
logits = h @ w["W1"] + w["b1"] # classes: airplane, automobile, bird, cat, deer, dog, frog, horse, ship, truck