Simplest neural network of one hidden layer. In the example it "learns" to imitate XOR function. Written in Node.js.
Usage: node xor.js
Outputs the results for (0, 0), (0, 1), (1, 0), (1, 1). Ideal would be 0 1 1 0
. As you can see, most of the times the network achieves 99% accuracy. And certainly enough to distinguish. Also works for any logical function of two arguments.