【机器学习】-Week4.3 Examples and Intu

2019-12-29  本文已影响0人  Kitty_风花

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 斯坦福 吴恩达 机器学习

上一篇下一篇

猜你喜欢

热点阅读