The machine learning part was built with tensorflow.js and the Layers API. The Graphics part was built using p5.js. At least 5 doodles are required to train the model. 10 or more are recommanded.
The code is available here.
All the training is done in the browser.
You can doodle on the right canvas even if training is not ended, it's recommanded to have loss < 0.01 to try.
Training progress:not started