Chapter 14

The Ten Most Important Classes

IN THIS CHAPTER

check Exploring fundamental classes of the TensorFlow API

check Storing tensors and operations in graphs

check Using estimators and iterators

The TensorFlow API is immense, comprising hundreds of packages and thousands of modules. Given its size, newcomers may find it hard to know which classes to study closely. To remedy this confusion, I selected TensorFlow’s ten most important classes and explain what the class accomplishes and why it’s so important.

Tensor

Tensors play a central role in TensorFlow development and serve as the primary objects for storing and manipulating data. Optimizers only accept data contained in tensors, and image-processing functions require images to be provided as tensors. All neural network layers, from dense layers to dropout layers, accept tensors as input and return tensors as output.

A tensor serves as an N-dimensional array, where N can be zero or more. A tensor’s number of dimensions is called the tensor’s rank, and the size of each dimension is called the tensor’s shape. For example, a 3-x-5 matrix has shape [3, 5], and an RGB image whose size is 200 x 200 would be represented by a tensor with size [200, ...

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.