We are taking a batch size of 32 and 6 epochs. We can play with these parameters to increase the accuracy.
Write the following code to train the model:
batch_size = 32
epochs = 6
history = model.fit(x_train,
y_train,
batch_size= batch_size,
epochs = epochs,
verbose=1,
validation_data= (x_test, y_test))
score = model.evaluate(x_test, y_test, verbose=0)
print('Test_loss:', score[0])
print('Test_accuracy:', score[1])
Here are the training results:
Fig 6.21: Model training
The training accuracy for the model is 95.84 and the test loss is 0.069.