๐Ÿ”Œ CNN-to-Linear Shape Mismatch Visualizer

Watch the image shrink, unfold, and plug in โ€” glowing green only when the numbers truly match.

๐Ÿ“‹ How To Use This Lab
  1. Adjust the Image Size, Kernel/Stride/Padding, and MaxPool sliders โ€” every shape updates live down the pipe.
  2. Watch the block physically shrink at each stage, then unfold into a flat line at Flatten.
  3. Type a guess into in_features โ€” if it's wrong, the plug shows red and disconnected, just like PyTorch's real error.
  4. Press โœ“ Auto-Calculate to snap in_features to the exact correct value and watch the plug glow green.
Flattened = 3136
โœ“ Connected
Input Image 3 ร— 28 ร— 28 Conv2d k=3, s=1, p=1 16 ร— 28 ร— 28 MaxPool2d pool=2ร—2 16 ร— 14 ร— 14 Flatten 16 ร— 14 ร— 14 = 3136 nn.Linear Input Socket

๐ŸŽ›๏ธ Architecture Parameters

๐Ÿ”Œ PLUGGYType a number into in_features โ€” I'll show you exactly whether it plugs in cleanly.
๐Ÿง‘โ€๐Ÿซ PROF. TORCHin_features must equal out_channels ร— H_final ร— W_final โ€” nothing more, nothing less.