Rather than building an example from first principles, let's instead walk through an excellent TensorFlow.js MNIST example. The goal of this example is to train a CNN to classify images of handwritten digits. More specifically, the goal of this example is to achieve a high accuracy in classifications made against the MNIST handwritten digit dataset. In this section, we will aim to get an understanding of the code and the algorithm by performing experiments on the code and observing their results.
The current version of this example may be found on TensorFlow.js's GitHub: https://github.com/tensorflow/tfjs-examples/tree/master/mnist. However, as the repository may be updated after this writing, I have also ...