Beginning with Deep Learning Using TensorFlow: A Beginners Guide to TensorFlow and Keras for Practicing Deep Learning Principles and Applications by Mohan Kumar Silaparasetty

Beginning with Deep Learning Using TensorFlow: A Beginners Guide to TensorFlow and Keras for Practicing Deep Learning Principles and Applications by Mohan Kumar Silaparasetty

Author:Mohan Kumar Silaparasetty [Silaparasetty, Mohan Kumar]
Language: eng
Format: epub
Publisher: BPB Publications
Published: 2022-08-15T00:00:00+00:00


Figure 4.57: To display training data=8

Location 2000 has Number 8. In addition to data, MNIST also provides some easy-to-use functions. For example, next_batch takes a number as a parameter and fetches that many images.

This piece of code will fetch randomly selected 100 images from the training data set. It returns the pixel values in batch_x and the labels in batch_y:

Figure 4.58: In built function—next_batch()

The shape of batch_x is [100, 784], which means there are 100 images in the flattened format of one-dimensional arrays of size 784. The shape of batch_y is [100,10], which means there are 100 one-hot encoded labels in the form of one-dimensional arrays of size 10 with exactly one cell set to 1 and others set to 0.

Let us examine some of the 10 images that are fetched:



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.