TrisZaska's Machine Learning Blog

Implement simple Multi-layer Neural Network by Python

1. Introduction
2. History and Overview about Artificial Neural Network
3. Single neural network
4. Multi-layer neural network
5. Install and using Multi-layer Neural Network to classify MNIST data
6. Summary
7. References

Visualize the problem of Perceptron

In this exercise, we reuse the Iris flower data set, but now, we adjust dataset a little bit to have non-linear data instead of linear data in the section \(3.2\) where Perceptron could solve it. Alright, let's prepare some non-linear data set now.
### Load some needed libraries ### Adjust Iris data a little bit and visualize the result ### Here are the result we obtained
### Now let’s use Perpceptron model we installed before to classify this data to see what happen, some codes to show the error of Perceptron on this data
### As we can see, the error of Perceptron is a flat line after 2000 epochs and never decrease, you can check this for yourself. Now let’s plot the Decision boundary of Perceptron, ### Here are the graph we obtained
Look at the Decision Boundary of Perceptron, it seems our model is fitting poorly with the data, right? In fact, Perceptron can not fit the non-linear data and why it can not we've already discussed in the previous section. So, let's use Multi-layer Neural Network to solve it.

No comments :

Post a Comment

Leave a Comment...