Chapter 11

Using Threads, Devices, and Clusters

IN THIS CHAPTER

check Configuring threads in applications

check Assigning operations to devices

check Creating distributed applications with clusters

I feel the need … the need for speed! If you’ve ever said this about machine learning, then this chapter is for you. In my experience, you can accelerate a TensorFlow application using four methods:

  • Generate multiple threads of execution
  • Access high-performance devices like graphics processor units (GPUs)
  • Execute an application on a cluster of networked devices
  • Deploy an application to the cloud

This chapter discusses the first three options and then demonstrates how to execute a TensorFlow application in a cluster. Chapter 13 explains how to run TensorFlow in the cloud.

Executing with Multiple Threads

A thread is a sequence of operations capable of executing independently from other threads. In a TensorFlow application, you can take advantage of threads in two main ways:

  • Perform time-consuming operations, such as the loading and storing of data, in separate threads. This approach lets your processing thread continue its work without interruption.
  • Run a session with multiple threads. In theory, ...

Get TensorFlow For Dummies now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.