Project DelphiTensors Workshop

The unfolding (H, W, C) → (H, W·C)

Unfolding — laying a tensor flat into a matrix along a documented axis choice. Spanish: desplegado (matricización).

A CNN may emit a feature tensor (Height, Width, Channels). The notebook chooses (H, W, C) → (H, W · C), so column w · C + c identifies one spatial column and one channel. A shared basis over image rows can then capture structure repeated across columns and channels.

For a PyTorch map (N, C, H, W), take one sample with features[0].permute(1, 2, 0) first.

The alternative is one (H, W) SVD per channel: separate row bases, at C · k · (H + W + 1) scalars. Neither unfolding is universally best; the choice encodes which structures you expect to share.