class
SomeOf
extends
_ContainerSomeOf(transforms: list[TransformLike], n: int = 1, p: float = 1.0)Apply n randomly-chosen children (Albumentations SomeOf).
Parameters
transformslist of TransformNo description.
nint= 1Number of children to apply (without replacement).
pfloat= 1.0No description.
Examples
>>> import lucid, lucid.utils.transforms as T
>>> tf = T.SomeOf([T.HorizontalFlip(p=1.0), T.VerticalFlip(p=1.0),
... T.Transpose(p=1.0)], n=2, p=1.0)
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 32, 32)
Picks n of them each call, so an augmentation pipeline varies
without listing every combination.