class
AutoAugment
extends
PhotometricTransform[_AutoAugmentParams]AutoAugment(policy: str = 'imagenet', num_magnitude_bins: int = 10, interpolation: str | Interpolation = Interpolation.BILINEAR, fill: float = 0.0, p: float = 1.0)AutoAugment (Cubuk et al., 2019 — arXiv:1805.09501).
Each call samples one of 25 fixed sub-policies uniformly; each
sub-policy is two (op, probability, magnitude_idx) triples
applied sequentially with their own probability gates. Three
policy tables are shipped, verbatim from the paper:
"imagenet"— Table 2 (default). General-purpose vision classification."cifar10"— Table 6. Small-image classification."svhn"— Table 7. Digits / OCR-style data.
Parameters
policystr= "imagenet"Which policy table to sample sub-policies from. Must be one
of
"imagenet", "cifar10", "svhn".num_magnitude_binsint= 10Magnitude bin count. The paper / reference framework uses
10 for AutoAugment (vs. 31 for RandAugment /
TrivialAugmentWide); the policy tables index into this size.No description.
fillfloat= 0.0No description.
pfloat= 1.0No description.
Notes
Photometric (image-only) by Lucid convention — see the module docstring.
Examples
>>> import lucid
>>> from lucid.utils.transforms import AutoAugment
>>> tf = AutoAugment(policy="imagenet")
>>> x = lucid.rand(3, 224, 224)
>>> y = tf(x)
>>> tuple(y.shape)
(3, 224, 224)Used by 2
Constructors
1Instance methods
1Sample per-call random parameters for AutoAugment.
Parameters
imgTensorImage tensor; not inspected, carried through for dispatch.
Returns
_AutoAugmentParamsCarries ops — the resolved sequence of
(op_name, signed_magnitude) pairs after sampling one
sub-policy uniformly from the active policy table and
gating each sub-op by its per-policy probability.
Ops in NO_MAGNITUDE_OPS are emitted with
magnitude 0.0; ops in SIGNED_OPS get a random
sign on the table-lookup magnitude.