Mirror
Mirroring is a transformation that reverses an image or array along one or more dimensions to produce a reflected variant.
Deep Learning with JAX
An array or image transformation that reverses the order of elements along a chosen dimension.
- How it is used
- Applies horizontal image reversal during preprocessing and randomized data augmentation.
- How deep it goes
- Explains axis selection and provides slicing and NumPy alternatives, but does not develop implementation internals.
- Examples
- Uses a cat image, horizontal pixel reversal, and a cat-and-dog classification augmentation pipeline.
- What you can do after
- Apply it via array slicing or NumPy flip() to reverse an image dimension.
Deep Learning with PyTorch, Second Edition
An augmentation operation that flips an input to create a reflected variant.
- How it is used
- Uses reflection to expand training data while preserving a sample’s representative content.
- How deep it goes
- Explains axis choice, pixel preservation, random selection, and caching order, but defers broader augmentation mechanics.
- Examples
- Demonstrates up-down, left-right, and front-back flips, including randomized CT-axis flips in PyTorch.
- What you can do after
- Apply it via PyTorch augmentation code by randomly negating selected transformation-matrix axes.
Read how Deep Learning with PyTorch, Second Edition explains mirror →
Related concepts
- data augmentationused by · Data augmentation is the process of adding or deriving examples, variables, or associated information from existing data to increase its variety or support subsequent analysis or computation.
- indexingequivalent to · Indexing is the organization or use of positions, keys, or lookup structures to identify and retrieve selected data or elements.
- slicingequivalent to · Slicing selects or partitions a portion of an indexed sequence or multidimensional array, often along specified indices or dimensions.
- dimensioncontrasts with · A dimension is an independent coordinate, measurable axis, or descriptive attribute used to represent, locate, or analyze something.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

