The Shape Guarantee

A layer needs to know which numbers belong to which example and how they are arranged. We will follow those dimensions through a network and see what changes when an image is flattened.

15 sections · 15 questions · 4 coding challenges

1 / 15

How Does a Grid of Features Reach a Final Decision?

BOTIE

An image-processing layer may produce several grids, one for each detected feature. A later layer may expect a single list of values per example. These are different organisations of numbers, so connecting them requires an explicit agreement about dimensions and ordering.

Document-recognition networks such as LeNet, described by LeCun and colleagues in 1998, combined spatial feature maps with later classification stages. That practical boundary makes shape bookkeeping important. Flattening is an array operation used to cross such boundaries, not a separate learning algorithm with a single invention story.

Flattening lays the existing values out in a fixed order. It does not calculate new evidence or learn which feature matters. The following layer does that. If we mix the example dimension with the feature dimensions, we can accidentally combine different observations. We will therefore name what each axis represents before changing the arrangement.

Sources for this history