Build a Neural Network from scratch in Python (Adam optimizer for SGD, and ReLU activation function)
- We use 3 blackbox datsets, each accompanied with a training data file, testing data, and predictions to verify model output
- Construct a Neural Network Classifier from the given training data (w/o ML library calls)
- Use the learned classifier to classify the unlabeled test data (Multi-Class labels)
- xavier() - xavier initialization as oposed to assigning andom weights
- relu() - it is used to compute output relu activation function
- inplace_relu_derivative() - it is used to compute derivative of relu function
- softmax() - it is used to compute softmax function for output layer
- log_loss() - it is used to compute logistic loss (cross entropy)
- SGDOptimizer Class - implements stochastic gradient descent optimizer algorithm with momentum.
- AdamOptimizer Class - implements adam optimizer algorithm.
- gen_batches() - split dataset to generate small batches.
- label_binarize() - binarize label for multiclass
- Split dataset to batches
- Initialize weights and bias - Xavier initialization
- Select one batch of data and calculate forward pass - follow the basic structure of neural network to compute output for each layer, and cache output of each layer for convenient of backward propagation.
- Compute loss function - cross-entropy (logistic loss)
- Backward propagation - use backprop to update hidden weights
- Updates weights using optimization algorithms - there are many ways to update weighs, utils.py has 2 (SGD and Adam)
- Repeat 2,3,4,5,6 for all batches - after finishing this process for all batches (it just iterates all data points of dataset), it is called ‘one epoch’.
- Repeat 2,3,4,5,6,7 number of epochs times - we train many epochs to get a good result
- Number of Hidden layers
- Number of Neurons in each hidden laye
- Learning Rate, or alpha
- Batch Size, which is no. of samples processed before model updated
- Number of epochs
- https://github.com/mnielsen/neural-networks-and-deep-learning
- http://neuralnetworksanddeeplearning.com/chap1.html
- https://www.youtube.com/watch?v=IHZwWFHWa-w
- https://stats.stackexchange.com/questions/181/how-to-choose-the-numberof-hidden-layers-and-nodes-in-a-feedforward-neural-netw
- https://towardsdatascience.com/weight-initialization-techniques-in-neuralnetworks-26c649eb3b78
- https://www.youtube.com/watch?v=x_Eamf8MHwU
- https://stats.stackexchange.com/questions/181/how-to-choose-the-numberof-hidden-layers-and-nodes-in-a-feedforward-neural-netw
- https://medium.com/binaryandmore/beginners-guide-to-deriving-andimplementing-backpropagation-e3c1a5a1e536
- https://ml-cheatsheet.readthedocs.io/en/latest/backpropagation.html
- https://towardsdatascience.com/weight-initialization-techniques-in-neuralnetworks-26c649eb3b78
- https://medium.com/datadriveninvestor/overview-of-different-optimizersfor-neural-networks-e0ed119440c3
- https://www.python-course.eu/neural_networks_with_python_numpy.php
- https://medium.com/better-programming/how-to-build-2-layer-neuralnetwork-from-scratch-in-python-4dd44a13ebba
- https://mattmazur.com/2015/03/17/a-step-by-step-backpropagationexample/
- https://medium.com/datadriveninvestor/overview-of-different-optimizersfor-neural-networks-e0ed119440c3