Loading...
Reshape flat data into image-like 3D arrays and back.
Images are typically 3D arrays: (height, width, channels)
Flattening and reshaping is common in deep learning:
Write a function image_reshape(flat_data, height, width, channels) that:
Return a dictionary with:
data = [0..11], height = 2, width = 2, channels = 3
Image shape [2, 2, 3], channels_first shape [3, 2, 2]
Reshape to (H,W,C), transpose to (C,H,W)