Search⌘ K
AI Features

Reshaping

Explore the process of reshaping input image data into the NHWC format required for convolutional neural networks. This lesson helps you understand how to convert flattened image tensors into four-dimensional tensors with batch size, height, width, and channel dimensions using TensorFlow. By mastering the reshaping step, you'll be prepared to build and train CNN layers for image recognition tasks effectively.

Chapter Goals:

  • Learn about NHWC format
  • Reshape the input data to NHWC

A. NHWC format

As mentioned in the previous chapter, inputs has shape (batch_size, self.input_dim**2). However, in order to use the data with our convolutional neural network, we need to get it into NHWC format.

NHWC format has a shape with four dimensions:

  1. Number of image data samples (batch size)
  2. Height of each image
  3. Width of each image
...