Description
This example works!
https://shiffman.github.io/Tensorflow-JS-Examples/01_XOR/
I am planning to recreate my XOR Coding Challenge in a video tutorial with the layers API. @nsthorat @dsmilkov @cvalenzuela @yining1023 feel free to take a look at the code in case you have any feedback!
This example at the moment is written in a slightly strange way as I'm experimenting with ideas for wrapping the layers API into new classes for ml5: NeuralNetwork
(likely not the same I will use) and Batch
. When I make a tutorial I will just walk through the steps without breaking things out into separate classes. And then eventually I'll make an even simpler ml5 tutorial?
The things I'm not super sure about:
- use of
tidy()
vs. individualdispose()
- how to run training effectively in a loop while also having an animation loop i.e. p5's
draw()
. - learning rate considerations
- epochs per training cycle considerations
- using
dataSync()
vsdata()
(in conjunction with an animation loop).
This is obviously a totally trivial example -- The XOR problem is one that helps me think through and learn how this stuff works. . so hopefully it's useful?