Examples and Intuitions I
A simple example of applying neural networks is by predicting x_1 AND x_2, which is the logical 'and' operator and is only true if both x_1 and x_2 are 1.
The graph of our functions will look like:
Remember that x_0 is our bias variable and is always 1.
Let's set our first theta matrix as:
This will cause the output of our hypothesis to only be positive if both x_1 and x_2 are 1. In other words:
So we have constructed one of the fundamental operations in computers by using a small neural network rather than using an actual AND gate. Neural networks can also be used to simulate all the other logical gates. The following is an example of the logical operator 'OR', meaning either x_1 is true or x_2 is true, or both:
Where g(z) is the following:
来源:coursera 斯坦福 吴恩达 机器学习
网友评论