# helia_edge.layers.preprocessing.random_choice

Batchwise random layer choice with captured branches and owned RNG.

## helia_edge.layers.preprocessing.random_choice.RandomChoice

`class` · `python`

```python
RandomChoice(layers: list[keras.Layer], batchwise: bool = True, **kwargs={})
```

Choose one layer for a whole batch; branches must have compatible outputs.

Per-example layer choice was never implemented and remains unsupported.
The next-major default is the supported ``batchwise=True`` mode.



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

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_choice.py:9`

### helia_edge.layers.preprocessing.random_choice.RandomChoice.layers

`attribute` · `python`

```python
layers = layers
```

Source: `helia_edge/layers/preprocessing/random_choice.py:23`

### helia_edge.layers.preprocessing.random_choice.RandomChoice.batchwise

`attribute` · `python`

```python
batchwise = batchwise
```

Source: `helia_edge/layers/preprocessing/random_choice.py:24`

### helia_edge.layers.preprocessing.random_choice.RandomChoice.build

`method` · `python`

```python
build(input_shape)
```

Source: `helia_edge/layers/preprocessing/random_choice.py:26`

### helia_edge.layers.preprocessing.random_choice.RandomChoice.batch_augment

`method` · `python`

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

Source: `helia_edge/layers/preprocessing/random_choice.py:32`

### helia_edge.layers.preprocessing.random_choice.RandomChoice.call

`method` · `python`

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

Source: `helia_edge/layers/preprocessing/random_choice.py:41`

### helia_edge.layers.preprocessing.random_choice.RandomChoice.get_config

`method` · `python`

```python
get_config()
```

Source: `helia_edge/layers/preprocessing/random_choice.py:49`

### helia_edge.layers.preprocessing.random_choice.RandomChoice.from_config

`method` · `python`

```python
from_config(config)
```

`classmethod`

Source: `helia_edge/layers/preprocessing/random_choice.py:56`
