Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Deep Learning with TensorFlow and Keras – 3rd edition - Third Edition

You're reading from  Deep Learning with TensorFlow and Keras – 3rd edition - Third Edition

Product type Book
Published in Oct 2022
Publisher Packt
ISBN-13 9781803232911
Pages 698 pages
Edition 3rd Edition
Languages
Authors (3):
Amita Kapoor Amita Kapoor
Profile icon Amita Kapoor
Antonio Gulli Antonio Gulli
Profile icon Antonio Gulli
Sujit Pal Sujit Pal
Profile icon Sujit Pal
View More author details

Table of Contents (23) Chapters

Preface 1. Neural Network Foundations with TF 2. Regression and Classification 3. Convolutional Neural Networks 4. Word Embeddings 5. Recurrent Neural Networks 6. Transformers 7. Unsupervised Learning 8. Autoencoders 9. Generative Models 10. Self-Supervised Learning 11. Reinforcement Learning 12. Probabilistic TensorFlow 13. An Introduction to AutoML 14. The Math Behind Deep Learning 15. Tensor Processing Unit 16. Other Useful Deep Learning Libraries 17. Graph Neural Networks 18. Machine Learning Best Practices 19. TensorFlow 2 Ecosystem 20. Advanced Convolutional Neural Networks 21. Other Books You May Enjoy
22. Index

How to use TPUs with Colab

In this section, we show how to use TPUs with Colab. Just point your browser to https://colab.research.google.com/ and change the runtime from the Runtime menu as shown in Figure 15.12. First, you’ll need to enable TPUs for the notebook, then navigate to EditNotebook settings and select TPU from the Hardware accelerator drop-down box:

Graphical user interface, text, application, chat or text message  Description automatically generated

Figure 15.12: Setting TPU as the hardware accelerator

Checking whether TPUs are available

First of all, let’s check if there is a TPU available, by using this simple code fragment that returns the IP address assigned to the TPU. Communication between the CPU and TPU happens via gRPC (gRPC Remote Procedure Call), which is a modern, open-source, high-performance Remote Procedure Call (RPC) framework that can run in any environment:

%tensorflow_version 2.x
import tensorflow as tf
print("Tensorflow version " + tf.__version__)
try:
  tpu = tf.distribute.cluster_resolver.TPUClusterResolver...
lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $15.99/month. Cancel anytime}