input: 
  def generate_mnist_model():
      """
      Generate a neural network model using TensorFlow for classifying hand-written digits from the MNIST dataset.
  
      >>> generate_mnist_model()
      Epoch: 0001 cost= 1.182584900
      Epoch: 0002 cost= 0.438710035
      Epoch: 0003 cost= 0.341234472
      Epoch: 0004 cost= 0.289597703
      Epoch: 0005 cost= 0.253579389
      Epoch: 0006 cost= 0.223776123
      Epoch: 0007 cost= 0.206278350
      Epoch: 0008 cost= 0.186036605
      Epoch: 0009 cost= 0.170719832
      Epoch: 0010 cost= 0.160987336
      Epoch: 0011 cost= 0.155424960
      Epoch: 0012 cost= 0.147534546
      Epoch: 0013 cost= 0.136810670
      Epoch: 0014 cost= 0.129495030
      Epoch: 0015 cost= 0.125947387
      Optimization Finished!
      Accuracy: 0.9234
      """
  
output:     import tensorflow as tf
      from tensorflow.keras import layers, models
      from tensorflow.keras.datasets import mnist
      from tensorflow.keras.utils import to_categorical
  
      # Load and preprocess the MNIST dataset
      (x_train, y_train), (x_test, y_test) = mnist.load_data()
      x_train = x_train.reshape(-1, 28, 28, 1).astype('float32') / 255
      x_test = x_test.reshape(-1, 28, 28, 1).astype('float32') / 255
      y_train = to_categorical(y_train, 10)
      y_test = to_categorical(y_test, 10)
  
      # Build the model
      model = models.Sequential([
          layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)),
          layers.MaxPooling2D((2, 2)),
          layers.Conv2D(64, (3, 3), activation='relu'),
          layers.MaxPooling2D((2, 2)),
          layers.Conv2D(64, (3, 3), activation='relu'),
          layers.Flatten(),
          layers.Dense(64, activation='relu'),
          layers.Dense(10, activation='softmax')
      ])
  
      # Compile the model
      model.compile(optimizer='adam',
                    loss='categorical_crossentropy',
                    metrics=['accuracy'])
  
      # Train the model
      history = model.fit(x_train, y_train, epochs=15, batch_size=64, validation_split=0.1)
  
      # Evaluate the model
      test_loss, test_acc = model.evaluate(x_test, y_test)
      print(f'Accuracy: {test_acc:.4f}')