Tiny Neural Network: XOR

One step = one gradient-descent update that uses all four examples: every weight and bias moves by −α times its partial derivative of L.

Starting weights (training starts from these numbers)

A random start draws every weight uniformly from −1 to 1 and sets the biases to 0; the same seed always gives the same numbers. You can also type any weight (open Edit the weights): training then restarts from your numbers.

Edit the weights W[1], b[1], W[2], b[2]
Show

Decision map

Network output ŷ(x1, x2) over the square −0.5 ≤ x1, x2 ≤ 1.5.

    Loss

    Loss L against the number of gradient-descent steps
    Loss L = ¼ Σk (ŷ(k) − y(k))², the mean squared error over the four XOR examples, against the number of gradient-descent steps. Dashed: the goal L = 0.05. Dotted: L = 0.25, the best any straight line can do.