A very simple xOr Neural Network using Tensorflowjs Layers
Have a look at the code. It would be very easy to add extra hidden layers to this Neural Network
The Original by
Matt Cameron was written for NodeJS, his code is at
Code and also @sqcai code-pen example
https://codepen.io/caisq/pen/vrxOvy
The expected output for xOr input is
[0,0] = ~ 0
[1,0] = ~ 1
[0,1] = ~ 1
[1,1] = ~ 0
Warning takes a while to train as the Neural Network only has a 2 node input, 10 node hidden layer and one node output.
...