1. Introduction
2. History and Overview about Artificial Neural Network
3. Single neural network
7. References
2. History and Overview about Artificial Neural Network
3. Single neural network
- 3.1 Perceptron
- 3.1.1 The Unit Step function
- 3.1.2 The Perceptron rules
- 3.1.3 The bias term
- 3.1.4 Implement Perceptron in Python
- 3.2 Adaptive Linear Neurons
- 3.2.1 Gradient Descent rule (Delta rule)
- 3.2.2 Learning rate in Gradient Descent
- 3.2.3 Implement Adaline in Python to classify Iris data
- 3.2.4 Learning via types of Gradient Descent
- 3.3 Problems with Perceptron (AI Winter)
- 4.1 Overview about Multi-layer Neural Network
- 4.2 Forward Propagation
- 4.3 Cost function
- 4.4 Backpropagation
- 4.5 Implement simple Multi-layer Neural Network to solve the problem of Perceptron
- 4.6 Some optional techniques for Multi-layer Neural Network Optimization
- 4.7 Multi-layer Neural Network for binary/multi classification
- 5.1 Overview about MNIST data
- 5.2 Implement Multi-layer Neural Network
- 5.3 Debugging Neural Network with Gradient Descent Checking
7. References
Implement Multi-layer Neural Network
It's quite similar when we installed Neural Network to solve the Problem of Perceptron, but in this exercise, we'll build stronger Multi-layer Neural Network to deal with real large data using all of the technique we learned, let's start.### Import several needed libraries ### Install MLP Classifier and some needed methods Alright, we've done install Neural Network, let's use prepared data to train the model. We use epochs=800 and minibatches=50. We also choose small learning rate eta, while adjusting the momentum alpha bigger and choose L2 Regularization for weight decay purpose. ### Here the result on my own computer
### And the error curve after traning
As you can see, the error curve is very noisy, right? Because we training our model using Mini-batch Gradient Descent. Do you remember? The properties of Mini-batch Gradient Descent is training on every mini-part of data instead of whole dataset one time (epoch), that lead to the above result. We're not showing here, but for better visualization with less noisy, you can calculate the mean after every epoch and plot it. Now, let's take a look at the accuracy in training and test samples.
### Print out the accuracy on test dataset
It seems our model work well on the training dataset rather than test dataset. So, it can make you imagine something we learned before, hm? Is it quite overfitting, isn't it? Alright, there are many useful techniques out there can help you tune the best parameters to achieves the best model for both training and testing, you maybe could find and check it for yourself, it's very fun. Now let's take a look at some numbers we classify correctly
### And some images our model classified incorrectly,
No comments :
Post a Comment
Leave a Comment...