# helia_edge.layers.preprocessing.frequency_mix_style

## Frequency Mix Style Layer API

This module provides classes to perform frequency mix style augmentation.

**Classes**

| Name | Description |
| --- | --- |
| `FrequencyMixStyle2D` | 2D frequency mix style augmentation |

## helia_edge.layers.preprocessing.frequency_mix_style.FrequencyMixStyle2D

`class` · `python`

```python
FrequencyMixStyle2D(probability: float = 0.5, alpha: float = 1.0, epsilon: float = 1e-06, **kwargs={})
```

Apply frequency mix style augmentation to the 2D input.

Example:

```python
    x = np.random.rand(4, 4, 3)
    lyr = FrequencyMixStyle2D(probability=1.0, alpha=1.0)
    y = lyr(x, training=True)
```



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).

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| probability | float | 0.5 | Probability of applying the augmentation. |
| alpha | float | 1.0 | Mixup alpha value. |
| epsilon | float | 1e-06 | Epsilon value for numerical stability. |

Source: `helia_edge/layers/preprocessing/frequency_mix_style.py:17`

### helia_edge.layers.preprocessing.frequency_mix_style.FrequencyMixStyle2D.probability

`attribute` · `python`

```python
probability: float = probability
```

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

### helia_edge.layers.preprocessing.frequency_mix_style.FrequencyMixStyle2D.alpha

`attribute` · `python`

```python
alpha: float = alpha
```

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

### helia_edge.layers.preprocessing.frequency_mix_style.FrequencyMixStyle2D.epsilon

`attribute` · `python`

```python
epsilon: float = epsilon
```

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

### helia_edge.layers.preprocessing.frequency_mix_style.FrequencyMixStyle2D.get_random_transformations

`method` · `python`

```python
get_random_transformations(input_shape: tuple[int, int, int]) -> dict
```

Generate noise distortion tensor

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| input_shape | tuple[int, ...] | Required | Input shape. |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
| dict | dict | Dictionary containing the noise tensor. |

Source: `helia_edge/layers/preprocessing/frequency_mix_style.py:53`

### helia_edge.layers.preprocessing.frequency_mix_style.FrequencyMixStyle2D.apply_mixstyle

`method` · `python`

```python
apply_mixstyle(x: keras.KerasTensor, lmda: keras.KerasTensor, perm: keras.KerasTensor) -> keras.KerasTensor
```

Apply mixstyle augmentation

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| x | tf.Tensor | Required | Input tensor |
| lmda | tf.Tensor | Required | Lambda tensor |
| perm | tf.Tensor | Required | Permutation tensor |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
|  | keras.KerasTensor | tf.Tensor: Augmented tensor |

Source: `helia_edge/layers/preprocessing/frequency_mix_style.py:72`

### helia_edge.layers.preprocessing.frequency_mix_style.FrequencyMixStyle2D.augment_samples

`method` · `python`

```python
augment_samples(inputs) -> keras.KerasTensor
```

Augment samples

**Parameters**

| Name | Type | Default | Description |
| --- | --- | --- | --- |
| inputs | tf.Tensor | Required | Input tensor |

**Returns**

| Name | Type | Description |
| --- | --- | --- |
|  | keras.KerasTensor | tf.Tensor: Augmented tensor |

Source: `helia_edge/layers/preprocessing/frequency_mix_style.py:97`

### helia_edge.layers.preprocessing.frequency_mix_style.FrequencyMixStyle2D.get_config

`method` · `python`

```python
get_config()
```

Source: `helia_edge/layers/preprocessing/frequency_mix_style.py:117`
