TL;DR build ANN from scratch and use the algorithm to train and test on mnist fashion data.
In the era of unstructured data such as images being one of the most collected data through applications such as facebook, instagram, pinterest and other such apps has really caused more images data to be available for DS to utilize for AI purpose.
In this repo, the repo has 50 hidden layers, with 28 * 28 input layer and 10 output layer as the mnist has 10 to be predicted classes
Image courtesy of link
- Input layer is number of neurons as what we are feeding in into the neural network - in mnist cases the number of features of each image 28 * 28 = 784
- Hidden layer is where the weight and bias is applied to train the model in learning and predicting the class for classification or value for regression
- Output layer is to return the predicted classes and the probability of each class to input, and take the highes proba value as final output
Predict MNIST fashion classes
Without scaling
Training accuracy: 54% | Test accuracy: 46%
- We can see that at one point the model is not getting better and the error is increasing and decreasing, the loss is not flattening
With scaling (to flatten the loss)
Training accuracy: 96% | Test accuracy: 86%
Orange line is with scaled input data, and we can see the training and test accuracy increased a lot and the loss is flatten now!
- Clone this repo
- Make sure you have all the libs install such as pandas, numpy, matplotlib, seaborn, scikit-learn
- Run
mnist_nn_classifier.py
- Enjoy the result