09.05.2023 Views

pdfcoffee

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Neural Network Foundations with TensorFlow 2.0

It is very simple; we just need to change a few lines:

# Compiling the model.

model.compile(optimizer='RMSProp',

loss='categorical_crossentropy', metrics=['accuracy'])

That's it. Let's test it:

Figure 19: Testing RMSProp

As you can see in the preceding screenshot, RMSProp is faster than SDG since we

are able to achieve in only 10 epochs an accuracy of 97.43% on training, 97.62%

on validation, and 97.64% on test. That's a significant improvement on SDG. Now

that we have a very fast optimizer, let us try to significantly increase the number of

epochs up to 250 and we get 98.99% accuracy on training, 97.66% on validation, and

97.77% on test:

[ 28 ]

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!