XOR Solution using NN
We all know the XOR problem is not linearly solvable.
Here is my pure math solution
Slow down to watch updates
Epochs: 0
Mean Squared Error: 0
| Input | Target | Network output |
|---|---|---|
| [0, 0] | 0 | - |
| [0, 1] | 1 | - |
| [1, 0] | 1 | - |
| [1, 1] | 0 | - |
The chart plots the mean squared error over the 4 XOR inputs every 100 epochs. It often plateaus for the first few hundred epochs before dropping. Some random initializations get stuck in a local minimum; if the error stops falling, train again.
This implementation is a JS modification of a neural network to solve the XOR problem.
It's similar to my Python implementation of a NN from scratch here