Returns an instance of tf.keras.Model for use with the MNIST example.

Used in the notebooks

Used in the tutorials

This code is based on the following target, which unfortunately cannot be imported as it is a Python binary, not a library:

compile_model If True, compile the model with a basic optimizer and loss.

A tf.keras.Model.