Class Transforms
java.lang.Object
ai.beestream.jitnn.data.Transforms
Per-sample transforms for
DataLoader, applied in place to one CHW sample on the host:
the usual image augmentations and normalisation. A transform draws from the random stream it is
given, which the loader derives from its seed, the epoch and the sample, so batches do not depend
on the number of workers.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfaceTransforms one sample ofshapeatx[at ..]in place. -
Method Summary
Modifier and TypeMethodDescriptionstatic Transforms.Transformnormalize(float[] mean, float[] std) (x - mean[c]) / std[c] per channel (torchvision's Normalize).static Transforms.TransformrandomCrop(int pad) Pads the image withpadzeros on every side and crops the original size back at a random offset (torchvision's RandomCrop(size, padding)).static Transforms.TransformMirrors the image left to right with probability 1/2 (torchvision's RandomHorizontalFlip).
-
Method Details
-
randomHorizontalFlip
Mirrors the image left to right with probability 1/2 (torchvision's RandomHorizontalFlip). -
randomCrop
Pads the image withpadzeros on every side and crops the original size back at a random offset (torchvision's RandomCrop(size, padding)). -
normalize
(x - mean[c]) / std[c] per channel (torchvision's Normalize).
-