input: Write a function to generate a neural network model using TensorFlow and Python for classifying hand-written digits from the MNIST dataset. The model should include the necessary parameters, weights, biases, and training operations.
  assert generate_mnist_model()[0]==True
  assert generate_mnist_model()[1]==True
  assert generate_mnist_model()[2]==True
  assert generate_mnist_model()[3]==True
  assert generate_mnist_model()[4]==True
output: def generate_mnist_model():
      import tensorflow as tf
      from tensorflow.keras import layers, models
      from tensorflow.keras.datasets import mnist
      from tensorflow.keras.utils import to_categorical
  
      (x_train, y_train), (x_test, y_test) = mnist.load_data()
      x_train = x_train.reshape((60000, 28, 28, 1)).astype('float32') / 255
      x_test = x_test.reshape((10000, 28, 28, 1)).astype('float32') / 255
      y_train = to_categorical(y_train)
      y_test = to_categorical(y_test)
  
      model = models.Sequential()
      model.add(layers.Conv2D(32, (3, 3), activation='relu', input_shape=(28, 28, 1)))
      model.add(layers.MaxPooling2D((2, 2)))
      model.add(layers.Conv2D(64, (3, 3), activation='relu'))
      model.add(layers.MaxPooling2D((2, 2)))
      model.add(layers.Conv2D(64, (3, 3), activation='relu'))
      model.add(layers.Flatten())
      model.add(layers.Dense(64, activation='relu'))
      model.add(layers.Dense(10, activation='softmax'))
  
      model.compile(optimizer='adam', loss='categorical_crossentropy', metrics=['accuracy'])
      model.fit(x_train, y_train, epochs=5, batch_size=64, validation_split=0.1)
  
      test_loss, test_acc = model.evaluate(x_test, y_test)
      return [test_acc > 0.9, test_loss < 0.3, model.layers[0].weights[0].shape == (3, 3, 1, 32), model.layers[2].weights[0].shape == (3, 3, 32, 64), model.layers[4].weights[0].shape == (3, 3, 64, 64)]