liveBook · Manning

Structural spatial prior

As explained in Inside Deep Learning: Math, Algorithms, Models

The assumption that nearby pixels and their arrangement carry meaning that should be exploited by image models.

A structural spatial prior treats nearby pixels and their arrangement as part of an image’s meaning. Reordering tensor values can destroy the structure that image models should exploit. section 3.1.1

Shuffling a handwritten digit

An MNIST image recognized as a 5 becomes meaningless when its tensor values are randomly shuffled. The pixel value cannot be interpreted independently of neighboring values. section 3.1.1

    rand_order = torch.randperm(x_example.shape[1] * x_example.shape[2]) 
    x_shuffled = x_example.view(-1)[rand_order].view(x_example.shape) 
    imshow(x_shuffled[0,:], cmap=’gray’)

[11]: <matplotlib.image.AxesImage at 0x7f6a1fb72cd0>

Use the tensor-shuffling listing to connect the prior directly to an image transformation and its visual consequence. section 3.1.1

How Inside Deep Learning: Math, Algorithms, Models covers it

How deep it goes
Explains the prior through tensor ordering and a shuffle experiment, then leads into convolutions without developing their mechanics.
Examples
Uses MNIST digits, channel stacking, RGB-like images, and randomly shuffled pixel tensors.
What it assumes
Assumes image values can be represented as tensors and establishes why their spatial order carries meaning.
What you can do after
Evaluate why preserving tensor order matters before applying convolutions to images.
How it connects
Ties pixel neighborhoods to image tensors and convolutions.

This explainer was generated by Manning's knowledge graph from the text of Inside Deep Learning: Math, Algorithms, Models. The section links point to the parts of the book it draws on.