W2_Quiz_Column Vector Image

Question Given:
image (32,32,3), How to reshape into column vector?

Doubts I have:

  1. Is X normally a column or row vector?
  2. Is the image flattened to 1 dimension or only the pixel is flattened as such (32*32, 3)

Hi @yeoh_zhewei

An image is made up of pixels. The height, width, are the size of the image (32 by 32) pixels, follows by 3, the RGB channels for coloured images. In order to feed this image into the algorithm, each image is converted into a vector, and X is a matrix containing all the samples. How the samples are arranged into the matrix is not fixed. If we have a total of 1000 images, the shape of the matrix would be (1000, 32*32*3) or ( 32*32*3,1000).

1 Like