Skip to content
class

Sequential

extends_Container
Sequential(transforms: list[TransformLike], p: float = 1.0)

Apply all children in order, gated by p (Albumentations Sequential).

The container's p controls whether the whole block runs at all on a given call — when the gate fails, every child is skipped and the input passes through unchanged. When the gate passes, each child is invoked left-to-right with its own probability gate honoured (unlike OneOf / SomeOf which bypass the child gate).

Parameters

transformslist of TransformLike
Children to chain — each receives the previous child's output.
pfloat= 1.0
Block-level probability — when below 1, the chain is a no-op on 1 - p of calls.

Examples

>>> import lucid, lucid.utils.transforms as T
>>> tf = T.Sequential([T.Resize(16, 16), T.HorizontalFlip(p=1.0)])
>>> tuple(tf(T.Image(lucid.rand(3, 32, 32))).data.shape)
(3, 16, 16)
Applies its members in order, and its own p decides whether the
whole run happens — unlike Compose, which always runs and
leaves each member to its own probability.

Used by 1

Constructors

2
dunder

__init__

→None
__init__(transforms: list[TransformLike], p: float = 1.0)
dunder

__call__

→object
__call__(inputs: object)

Instance methods

1
fn

make_params

→Emptyfrom _NoParams
make_params(img: Tensor)

Dunder methods

1