liveBook · Manning

Manifold

As explained in Deep Learning with Python, Third Edition

A lower-dimensional geometric subspace that is locally similar to Euclidean space, used here to describe the structure of valid data samples.

An image classifier can accept far more inputs than there are plausible images. A 28 × 28 array of pixel values has an enormous number of possible configurations, but only a tiny, structured portion looks like a handwritten digit. That portion is a data manifold: a lower-dimensional subspace that, nearby, resembles a line or surface. section 5.1.2

Moving between handwritten digits

Slightly change a recognizable digit and it will usually remain recognizable. Digits can also be connected by sequences of small changes that pass through digit-like images, though shapes near class boundaries may be ambiguous. This does not mean that averaging the pixels of two digits produces a valid digit: a path along the manifold differs from a straight line through the surrounding input space. section 5.1.2

Figure 5.8 Difference between linear interpolation and interpolation on the latent manifold. Every point on the latent manifold of digits is a valid digit, but the average of two digits usually isn’t.
linear interpolation vs manifold interpolation

Compare straight-line interpolation with interpolation on the latent manifold; the figure shows why a pixel average need not be a valid digit. section 5.1.2

This structure helps explain generalization. A neural network can fit even randomly shuffled labels, so fitting training samples alone is not enough. Useful generalization comes from approximating the data’s latent manifold and interpolating between sufficiently nearby training samples. It depends on dense coverage of the relevant inputs; predictions can stop making sense when inputs move far from what the model has seen. section 5.1.2 section 5.5

Think of two colored sheets crumpled together: each sheet is a class, and successive neural-network layers transform the tangled shape until the classes are easier to separate. Feature engineering offers another route—choose a representation that makes the latent manifold smoother and simpler. For a clock image, extracting hand-tip coordinates and then hand angles makes the task much easier. section 2.3.6 section 5.4.2

Rule of thumb: include the variations on which a model must perform in its training data; data augmentation can help capture anticipated variations. Manifold-based interpolation supports local generalization, not reliable adaptation to substantially novel situations or every kind of algorithmic reasoning. section 19.2.2 section 19.2

How Deep Learning with Python, Third Edition covers it

How deep it goes
Defines a manifold intuitively and works through handwritten-digit paths and interpolation, without a formal geometric derivation.
Examples
Uses handwritten digits, crumpled colored sheets, and clock-hand features to illustrate data structure and simpler representations.
What it assumes
Starts from familiar images and a paper analogy, introducing the geometric meaning without requiring a formal definition.
What you can do after
Evaluate/understand why nearby inputs may generalize while unfamiliar variations require better training coverage.
How it connects
Links manifolds to generalization, representation learning, feature engineering, and data augmentation.

Also explained in

Compare how 3 books explain manifold →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Deep Learning with Python, Third Edition. The section links point to the parts of the book it draws on.