The function format_example in Code Cell 7 has not normalized the image correctly. We expected the pixel values to be divided by 255.0.
Example: how to standardize the image data to have values between 0 and 1
# Standardize data to have feature values between 0 and 1.
train_x = train_x_flatten/255.
test_x = test_x_flatten/255.