class
Sequential
extends
_ContainerSequential(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 TransformLikeChildren to chain — each receives the previous child's
output.
pfloat= 1.0Block-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
2Initialise the layer. See the class docstring for parameters.
Label every prediction.
Parameters
iou(M, N) IoU between M ground truths and N
predictions, as produced by box_iou.Returns
object(N,) int tensor. Entry n is the ground-truth index
Raises
ValueErrorIf there are no ground-truth rows. With nothing to
match against, every prediction is background — but the
caller has to say so explicitly, because silently returning
all-negative hides an empty-target bug.