Standardize image dimension ordering to (C, H, W)
mainThe book uses channels-first ordering for all image dimensions.
- Standard:
(C, H, W)(Channels, Height, Width). - Action: Convert any
(H, W, C)orderings (e.g.,\x \in \mathbb{R}^{H \times W \times 3}) to the(C, H, W)format (e.g.,\mathbb{R}^{c \times h \times w}).
% Correct (Channels-first)
\mathbb{R}^{c \times h \times w}
% Incorrect (Channels-last)
\mathbb{R}^{h \times w \times c}