This repository has an elementary implementation of a Multi Layer perceptron with 3 Layers and 5 Nodes in the hidden layer
Note: Implementation has input with 785 features. Sorry ! couldn't accomodate that many in the picture.
- calculateSigmoid ! calculates sigmoid of every element in the matrix.
- calculateMatrixDotProduct ! calculates dot product of two given matrices.
- calculateSigmoidDerivative ! Calculates (1 - sigMatrix)*sigMatrix, (1-O)*O
- predict ! predicts a data sample given input and relevant weights, returns in one hot encoded format.
- errorCumulative!calculates total error of all data samples given target(t) and output(O).
- calculateYofLayer ! calculates sigmoid(WtX) of a any given layer.
- calculateAccuracy ! calculates accuracy given target(t) and output(O).
- addBiasTerm ! adds bias term 1 to all the data samples passed as a matrix
- trainModel !
- Loads the training data and labels.
- Initializes random weights for the start.
- Runs epochs with feed forward and backpropagation logic till error value is below a considered value.
- Check accuracy on validate dataset.
- Saves the trained weights.
- Takes path of directory where test data exists.
- Loads the model.
- calls tarinModel from nn.py and gets the weights saved
- Predicts the data test samples.