Skip to Content
Neural Network Projects with Python
book

Neural Network Projects with Python

by James Loy
February 2019
Beginner to intermediate
308 pages
7h 42m
English
Packt Publishing
Content preview from Neural Network Projects with Python

Analyzing the results

Let's plot the validation accuracy per epoch for the three different models. First, we plot for the model trained using the sgd optimizer:

from matplotlib import pyplot as pltplt.plot(range(1,11), SGD_score.history['acc'], label='Training Accuracy')plt.plot(range(1,11), SGD_score.history['val_acc'],          label='Validation Accuracy')plt.axis([1, 10, 0, 1])plt.xlabel('Epoch')plt.ylabel('Accuracy')plt.title('Train and Validation Accuracy using SGD Optimizer')plt.legend()plt.show()

We get the following output:

Did you notice anything wrong? The training and validation accuracy is stuck at 50%! Essentially, this shows that the ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Machine Learning with Python Cookbook

Machine Learning with Python Cookbook

Chris Albon

Publisher Resources

ISBN: 9781789138900Supplemental Content