Skip to content
heliaEDGE
Reference
HELIA

random_augmentation_pipeline

Repeated batchwise random choices sharing the standard training contract.

Machine-readable model

class

Apply repeated random layer choices to an entire batch.

helia_edge/layers/preprocessing/random_augmentation_pipeline.py:9

RandomAugmentation1DPipeline(
layers: list[keras.Layer],
augmentations_per_sample: int = 1,
rate: float = 1.0,
batchwise: bool = True,
force_training: bool = False,
**kwargs={},
)

Apply repeated random layer choices to an entire batch.

Each round samples one layer for the batch, with replacement, and applies it with probability rate. Inference is unchanged unless force_training is enabled. Candidate layers must produce compatible shapes and structures.

Base class: RandomChoice.

Inherited from RandomChoice: build(), from_config().

Inherited from BaseAugmentation: augment_masks(), augment_sample(), augment_samples(), augment_targets(), get_random_transformations().

Parameters of RandomAugmentation1DPipeline
NameTypeDefaultDescription
layerslist[keras.Layer]RequiredNonempty list of candidate augmentation layers.
augmentations_per_sampleint1Number of batchwise selection rounds. Zero leaves the input unchanged.
ratefloat1.0Probability of applying each round, between zero and one.
batchwiseboolTrueMust be True; per-example layer selection is unsupported.
force_trainingboolFalseApply augmentation even when training is False or None.
**kwargsAny{}Base augmentation options, including seed and data_format.
Errors raised by RandomAugmentation1DPipeline
TypeDescription
ValueErrorThe layer list is empty, the round count is not a nonnegative integer, rate is outside [0, 1], or explicit transformations are used.
NotImplementedErrorbatchwise is False.
class

The same batchwise composition contract for image transforms.

helia_edge/layers/preprocessing/random_augmentation_pipeline.py:82

RandomAugmentation2DPipeline(
layers: list[keras.Layer],
augmentations_per_sample: int = 1,
rate: float = 1.0,
batchwise: bool = True,
force_training: bool = False,
**kwargs={},
)