# A simple Neural Network, finding weights to achieve 100% accuracy

So I've been watching lectures and doing the problem sheets from the class CS 229 2017, taught at Stanford by Andrew Ng. In problem sheet 3 he puts forward the following question:

$\textbf{So this is what I did in part a)}$

What we have is:

$\sigma(z) = \frac{1}{1+e^{-z}}$ and it's derivative is $\sigma'(z)=\sigma(z)(1-\sigma(z))$

$l=\frac{1}{n} \sum^{n}_{i=1} (o^{i}-y^{i})^2$

From this we can calculate:

$\textbf{Then for part b)}$ Here I'm completely lost. I'm guessing the triangle that he talks about is the following:

However, I don't understand how I would choose the weights in such a way that I would achieve 100% accuracy. Any help or hint would be very well appreciated!

• The first hidden neuron will represent $x_1 > 0.5$
• The second will represent $x_2 > 0.5$
• The third will represent $x_1 + x_2 < 1$
• The straight lines aren't exactly caused by the sigmoid function. They come from the weights: an equation like ax_1 + bx_2 + c = 0 represents a straight line, and this weighted sum is exactly the input to the sigmoid functions. – Greg d'Eon Mar 29 '18 at 20:39