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.

Advanced Convolutional Neural Networks

And evaluate with the following code:

estimator.evaluate(lambda:input_fn(test_images,

test_labels,

epochs=1,

batch_size=BATCH_SIZE))

If we run the code in Colab (Colab code can be found at https://colab.research.

google.com/drive/1mf-PK0a20CkObnT0hCl9VPEje1szhHat) we get the following

results:

Figure 12: Results from Colab

Run Fashion-MNIST the tf.keras - estimator

model on GPUs

In this section we aim at running the estimator on GPUs. All we need to do is to

change the strategy into a MirroredStrategy(). This strategy uses one replica per

device and sync replication for its multi-GPU version:

At this point we can start training:

Figure 13: Implementing the MirroredStrategy strategy

Figure 14: Training with MirroredStrategy

[ 150 ]

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

Saved successfully!

Ooh no, something went wrong!