input: def generate_mnist_nn_model():
      """Generate a TensorFlow neural network model for classifying hand-written digits from the MNIST dataset.
      >>> generate_mnist_nn_model()
      Epoch: 0001 cost= 1.182628193
      Epoch: 0002 cost= 0.432474979
      Epoch: 0003 cost= 0.338378223
      Epoch: 0004 cost= 0.293965035
      Epoch: 0005 cost= 0.263412347
      Epoch: 0006 cost= 0.239836284
      Epoch: 0007 cost= 0.221493741
      Epoch: 0008 cost= 0.205172513
      Epoch: 0009 cost= 0.192573459
      Epoch: 0010 cost= 0.179178755
      Epoch: 0011 cost= 0.168540087
      Epoch: 0012 cost= 0.158256083
      Epoch: 0013 cost= 0.148557742
      Epoch: 0014 cost= 0.141839247
      Epoch: 0015 cost= 0.134450802
      Optimization Finished!
      Accuracy: 0.9453
      """
output:     import tensorflow as tf
      from tensorflow.keras import layers, models
  
      model = models.Sequential([
          layers.Flatten(input_shape=(28, 28)),
          layers.Dense(128, activation='relu'),
          layers.Dropout(0.2),
          layers.Dense(10, activation='softmax')
      ])
  
      model.compile(optimizer='adam',
                    loss='sparse_categorical_crossentropy',
                    metrics=['accuracy'])
  
      mnist = tf.keras.datasets.mnist
      (x_train, y_train), (x_test, y_test) = mnist.load_data()
      x_train, x_test = x_train / 255.0, x_test / 255.0
  
      class PrintCostCallback(tf.keras.callbacks.Callback):
          def on_epoch_end(self, epoch, logs=None):
              print(f'Epoch: {epoch+1:04d} cost= {logs["loss"]:.9f}')
  
      model.fit(x_train, y_train, epochs=15, callbacks=[PrintCostCallback()])
  
      test_loss, test_acc = model.evaluate(x_test, y_test)
      print(f'Optimization Finished!\nAccuracy: {test_acc:.4f}')
  
      return model