When applying two hidden layers, for the entire training set, the model achieved a slightly improvement. The model with 1 layer, 100 nodes, showed an accuracy of 96.28% while with two layers we have 96.61%. For the small training set we will keep with 1 layer with 100 nodes, but for the full training set we will use 2 layers with 100 nodes each.

We still have some more hyperparameters to analyze, in order to further improve our final model.

Regularization

During all our analyzes, we used the regularization factor $\lambda = 0.01$, the default value for L2 Regularization in keras. Now we will try other values for $\lambda$ as well as other regularization methods.

Regularization is used in order to add a fraction of the layers weights to the original loss function. The factor $\lambda$ controls how much these weights will influence the function. This process helps the model to find better weight values, and also minimizes outliers impacts.

L2 Regularization: $\lambda = 0.001$

We will start with $\lambda = 0.001$, ten times smaller than the default value.