CutMix collator (Yun et al., 2019 — arXiv:1905.04899).
Same lambda-sampling scheme as MixupCollator, but instead
of blending pixels globally, a rectangular patch of one image is
pasted onto another. The effective is recomputed
from the actual patch area (after border clamping) so soft
targets stay calibrated.
Parameters
alphafloat= 1.0Beta-distribution concentration. Reference-framework recipes
use
1.0 for ImageNet (uniform ).num_classesintOutput class count.
pfloat= 1.0Probability of applying CutMix per batch.
Notes
Patch placement uses a multiplicative keep-mask + additive paste
(the same composition pattern as
lucid.utils.transforms.RandomErasing) — fully
differentiable, no in-place writes.