These are the solutions for Section 3 of the Machine Learning in JavaScript with TensorFlow.js course. See solutions index for solutions to other sections.
See exercise1.html.
I have included examples for all the suggestions listed in the exercise, but there are is always more to try! If you are struggling with this please keep playing with Tensor creation and the math functions until you feel you understand.
See exercise2.html.
See exercise3.html.
See exercise4.html.
The previous exercise solutions also include memory management with tf.tidy(...)
to ensure that no tensors are left in memory.
See solutions index for solutions to other sections.