Tech stack: PyTorch, TorchVision, Matplotlib, NumPy.
Dataset used: MNIST handwritten dataset, link here.
Description: The model is a PyTorch neural network having a single linear layer. The number of image pixels is the input array size and the number of classes is the output size. The weight given to each pixel by the model is visually plotted for each class, before and after training. Cross Entropy Loss is chosen as the criterion function, which uses Softmax to convert the model’s output to probabilities of each class being assigned to the input image. The model was trained in 10 epochs. Visualisation of post-training model parameters reveal characteristic digit shapes.
Resulting accuracy metrics:
92% correctly classified digits on the testing dataset in the final training epoch.
Cross Entropy Loss = 0.3 on the training dataset in the final training epoch.
Post-training model parameters: