# helia_edge.layers.preprocessing.random_augmentation_pipeline

Repeated batchwise random choices sharing the standard training contract.

## helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline

`class` · `python`

```python
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](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_choice/#helia_edge.layers.preprocessing.random_choice.RandomChoice).

Inherited from [RandomChoice](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_choice/#helia_edge.layers.preprocessing.random_choice.RandomChoice): [build()](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_choice/#helia_edge.layers.preprocessing.random_choice.RandomChoice.build), [from_config()](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_choice/#helia_edge.layers.preprocessing.random_choice.RandomChoice.from_config).

Inherited from [BaseAugmentation](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation): [augment_masks()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_masks), [augment_sample()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_sample), [augment_samples()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_samples), [augment_targets()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_targets), [get_random_transformations()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.get_random_transformations).

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| layers | list[keras.Layer] | Required | Nonempty list of candidate augmentation layers. |
| augmentations_per_sample | int | 1 | Number of batchwise selection rounds. Zero leaves the input unchanged. |
| rate | float | 1.0 | Probability of applying each round, between zero and one. |
| batchwise | bool | True | Must be True; per-example layer selection is unsupported. |
| force_training | bool | False | Apply augmentation even when training is False or None. |
| **kwargs | Any | {} | Base augmentation options, including seed and data_format. |

**Raises**

| Name | Description |
| --- | --- |
| ValueError | The layer list is empty, the round count is not a nonnegative integer, rate is outside [0, 1], or explicit transformations are used. |
| NotImplementedError | batchwise is False. |

Source: `helia_edge/layers/preprocessing/random_augmentation_pipeline.py:9`

### helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline.augmentations_per_sample

`attribute` · `python`

```python
augmentations_per_sample = augmentations_per_sample
```

Source: `helia_edge/layers/preprocessing/random_augmentation_pipeline.py:50`

### helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline.rate

`attribute` · `python`

```python
rate = rate
```

Source: `helia_edge/layers/preprocessing/random_augmentation_pipeline.py:51`

### helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline.force_training

`attribute` · `python`

```python
force_training = force_training
```

Source: `helia_edge/layers/preprocessing/random_augmentation_pipeline.py:52`

### helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline.batch_augment

`method` · `python`

```python
batch_augment(inputs, transformations=None)
```

Source: `helia_edge/layers/preprocessing/random_augmentation_pipeline.py:54`

### helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline.call

`method` · `python`

```python
call(inputs, training=None, transformations=None)
```

Source: `helia_edge/layers/preprocessing/random_augmentation_pipeline.py:70`

### helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline.get_config

`method` · `python`

```python
get_config()
```

Source: `helia_edge/layers/preprocessing/random_augmentation_pipeline.py:73`

## helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation2DPipeline

`class` · `python`

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

The same batchwise composition contract for image transforms.



Base class: [RandomAugmentation1DPipeline](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_augmentation_pipeline/#helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline).

Inherited from [RandomAugmentation1DPipeline](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_augmentation_pipeline/#helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline): [batch_augment()](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_augmentation_pipeline/#helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline.batch_augment), [call()](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_augmentation_pipeline/#helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline.call), [get_config()](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_augmentation_pipeline/#helia_edge.layers.preprocessing.random_augmentation_pipeline.RandomAugmentation1DPipeline.get_config).

Inherited from [RandomChoice](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_choice/#helia_edge.layers.preprocessing.random_choice.RandomChoice): [build()](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_choice/#helia_edge.layers.preprocessing.random_choice.RandomChoice.build), [from_config()](/helia-edge/reference/api/helia_edge/layers/preprocessing/random_choice/#helia_edge.layers.preprocessing.random_choice.RandomChoice.from_config).

Inherited from [BaseAugmentation](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation): [augment_masks()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_masks), [augment_sample()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_sample), [augment_samples()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_samples), [augment_targets()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_targets), [get_random_transformations()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.get_random_transformations).

Source: `helia_edge/layers/preprocessing/random_augmentation_pipeline.py:82`
