# helia_edge.layers.preprocessing.spec_augment

Signal-only spectrogram masking using the shared augmentation contract.

## helia_edge.layers.preprocessing.spec_augment.SpecAugment2D

`class` · `python`

```python
SpecAugment2D(
    freq_mask_param: int,
    time_mask_param: int,
    n_freq_mask: int = 1,
    n_time_mask: int = 1,
    mask_value: float = 0.0,
    **kwargs={},
)
```

Mask frequency (height) and time (width), independently per example.



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

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_targets()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.augment_targets), [batch_augment()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.batch_augment), [call()](/helia-edge/reference/api/helia_edge/layers/preprocessing/base_augmentation/#helia_edge.layers.preprocessing.base_augmentation.BaseAugmentation.call).

Source: `helia_edge/layers/preprocessing/spec_augment.py:10`

### helia_edge.layers.preprocessing.spec_augment.SpecAugment2D.get_random_transformations

`method` · `python`

```python
get_random_transformations(input_shape)
```

Source: `helia_edge/layers/preprocessing/spec_augment.py:30`

### helia_edge.layers.preprocessing.spec_augment.SpecAugment2D.augment_samples

`method` · `python`

```python
augment_samples(inputs)
```

Source: `helia_edge/layers/preprocessing/spec_augment.py:42`

### helia_edge.layers.preprocessing.spec_augment.SpecAugment2D.get_config

`method` · `python`

```python
get_config()
```

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