Reshaping
Reshape image data from the basic 2-D matrix format into NHWC format.
We'll cover the following...
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:
- Number of image data samples (batch size)
- Height of each image
- Width of each image