Problem 1 Load the MNIST data in keras package. Build a neural

Problem 1

Load the MNIST data in keras package. Build a neural network with two hidden layers (265 nodes for the first hidden layer and 128 nodes for the second hidden layer).

Calculate the total number of parameters in this model (show detailed steps for the calculations).

Specify different optimizer: Adagrad (set: optimizer = optimizer_adagrad() in compile), and RMSprop

(set: optimizer_rmsprop() in compile). Train the model with batch size 128 and use 20 epoch. Compare the performance of different optimizers uses the plot of accuracy vs. epoch.

Add a third hidden layer with 128 nodes. Fit the model using RMSprop, batch size 128, and use 20 epoch. Does adding the third hidden layer improve the performance?

Problem 2

Load the fashion_MNIST data in keras package (use function dataset_fashion_mnist(). Build a neural network with two hidden layers (265 nodes for the first hidden layer and 128 nodes for the second hidden layer).

Calculate the total number of parameters in this model (show detailed steps for the calculations).

Specify different optimizers: Adagrad, and RMSprop. Train the model with batch size 128 and use 20 epoch. Compare the performance of different optimizers by using the plot of accuracy vs. epoch.

Challenge problem: based on the performance of different Neural networks in (https://github.com/zal andoresearch/fashion-mnist), the performance of MLP of 256-128-100 is 0.8833. Could you adjust the architecture or add regularization to make the accuracy improve to 0.89?

1