YAML Metadata Warning:empty or missing yaml metadata in repo card

Check out the documentation for more information.

Selected Models for SMAI Assignment 4 – Question 1

This repository contains the selected Multi-Layer Perceptron (MLP) and IOC-NN models evaluated on the CIFAR-10 dataset.

The MLP is implemented from scratch using NumPy, while the IOC-NN model is implemented using PyTorch.

1. Model Architectures

1.1 Multi-Layer Perceptron (MLP)

Property Description
Implementation NumPy (from scratch)
Data Type float64
Architecture 3072 β†’ 64 β†’ 10
Hidden Activation ReLU
Output Activation Identity (Linear logits)
Number of Parameters 197,322
Validation Accuracy 48.67%
Test Accuracy 48.95%

Model File: selected_mlp_cifar10.npz

1.2 IOC-NN

Property Description
Implementation PyTorch (torch.nn)
Architecture 3072 β†’ 64 β†’ 10
Hidden Activation ELU
Output Activation Identity (Linear logits)
Number of Parameters 197,322
Test Accuracy (Clean, p = 0) 45.52%
Best Epoch Test Accuracy 50.66%

Model Files:

  • selected_iocnn_cifar10.npz
  • selected_iocnn_cifar10_state_dict.pth

Weight Constraints

For the IOC-NN model, the weights of layers with index $\ell \geq 2$ are constrained to be non-negative:

W(β„“)β‰₯0,β„“β‰₯2 W^{(\ell)} \geq 0, \qquad \ell \geq 2

The constraint is enforced using the following projection:

w←ewβˆ’5 \boxed{w \leftarrow e^{w-5}}

2. Dataset and Preprocessing

Both models use the CIFAR-10 dataset, which consists of RGB images of dimensions $32 \times 32$.

2.1 Input Dimensions

Each image is flattened into a one-dimensional feature vector:

32Γ—32Γ—3=3072 32 \times 32 \times 3 = 3072

Therefore, the input dimension of both models is:

dinput=3072 \boxed{d_{\text{input}} = 3072}

2.2 Pixel Scaling

The original pixel values are integers in the range $[0,255]$.

They are scaled to the range $[0,1]$ using:

xscaled=x255.0 \boxed{x_{\text{scaled}} = \frac{x}{255.0}}

The resulting data is represented using float64.

2.3 Feature Standardization

After scaling, the input features are standardized column-wise using the mean and standard deviation calculated exclusively from the training split.

The standardization formula is:

xnorm=xscaledβˆ’ΞΌtrainΟƒtrain \boxed{ x_{\text{norm}} = \frac{x_{\text{scaled}}-\mu_{\text{train}}} {\sigma_{\text{train}}} }

where:

  • $x_{\text{scaled}}$ represents the scaled input feature.
  • $\mu_{\text{train}}$ represents the training-set mean.
  • $\sigma_{\text{train}}$ represents the training-set standard deviation.
  • $x_{\text{norm}}$ represents the standardized feature.

Note: Validation and test data use the same training-set statistics for standardization. Their own means and standard deviations are not used, preventing data leakage.

3. Model Summary

Both selected models use the same architecture:

3072β†’64β†’10 \boxed{3072 \rightarrow 64 \rightarrow 10}

The primary differences are their implementations and hidden-layer activation functions:

Feature MLP IOC-NN
Framework NumPy PyTorch
Hidden Activation ReLU ELU
Output Activation Identity Identity
Weight Constraints Not specified Non-negative weights for $\ell \geq 2$

Both models produce 10 output logits corresponding to the 10 CIFAR-10 classes.

Downloads last month

-

Downloads are not tracked for this model. How to track
Inference Providers NEW
This model isn't deployed by any Inference Provider. πŸ™‹ Ask for provider support