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
