Skip to content
heliaEDGE
Reference
HELIA

frequency_mix_style

This module provides classes to perform frequency mix style augmentation.

Classes

Name Description
FrequencyMixStyle2D 2D frequency mix style augmentation

Machine-readable model

class

Apply frequency mix style augmentation to the 2D input.

helia_edge/layers/preprocessing/frequency_mix_style.py:17

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

Apply frequency mix style augmentation to the 2D input.

Example:

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

Base class: BaseAugmentation2D.

Inherited from BaseAugmentation: augment_masks(), augment_sample(), augment_targets(), batch_augment(), call().

Parameters of FrequencyMixStyle2D
NameTypeDefaultDescription
probabilityfloat0.5Probability of applying the augmentation.
alphafloat1.0Mixup alpha value.
epsilonfloat1e-06Epsilon value for numerical stability.
method

Generate noise distortion tensor

helia_edge/layers/preprocessing/frequency_mix_style.py:53

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

Generate noise distortion tensor

Parameters of get_random_transformations
NameTypeDefaultDescription
input_shapetuple[int, ...]RequiredInput shape.
Returns of get_random_transformations
ValueTypeDescription
dictdictDictionary containing the noise tensor.
method

Apply mixstyle augmentation

helia_edge/layers/preprocessing/frequency_mix_style.py:72

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

Apply mixstyle augmentation

Parameters of apply_mixstyle
NameTypeDefaultDescription
xtf.TensorRequiredInput tensor
lmdatf.TensorRequiredLambda tensor
permtf.TensorRequiredPermutation tensor
Returns of apply_mixstyle
TypeDescription
keras.KerasTensortf.Tensor: Augmented tensor