October 2018
Intermediate to advanced
472 pages
10h 57m
English
To evaluate the model on test data, you can call the evaluate method of the model by feeding the test images and test labels:
# evaluate the modelloss, acc = model.evaluate(X_test, y_test)print('Test loss:', loss)print('Accuracy:', acc)
The following is the output of the preceding code:

From the validation and test accuracy, we can see that after 20 epochs of training, we have reached the same level of accuracy as we did in Chapter 2, Training NN for Prediction Using Regression, but with very few lines of code.
Now, let's define a function to plot the train and validation loss ...
Read now
Unlock full access