frequency_mix_style
Frequency Mix Style Layer API
This module provides classes to perform frequency mix style augmentation.
Classes:
-
FrequencyMixStyle2D–2D frequency mix style augmentation
Classes
FrequencyMixStyle2D
Apply frequency mix style augmentation to the 2D input.
Parameters:
-
(probabilityfloat, default:0.5) –Probability of applying the augmentation.
-
(alphafloat, default:1.0) –Mixup alpha value.
-
(epsilonfloat, default:1e-06) –Epsilon value for numerical stability.
Example:
x = np.random.rand(4, 4, 3)
lyr = FrequencyMixStyle2D(probability=1.0, alpha=1.0)
y = lyr(x, training=True)
Source code in neuralspot_edge/layers/preprocessing/frequency_mix_style.py
Functions
get_random_transformations
Generate noise distortion tensor
Parameters:
Returns:
-
dict(dict) –Dictionary containing the noise tensor.
Source code in neuralspot_edge/layers/preprocessing/frequency_mix_style.py
apply_mixstyle
Apply mixstyle augmentation
Parameters:
-
(xTensor) –Input tensor
-
(lmdaTensor) –Lambda tensor
-
(permTensor) –Permutation tensor
Returns:
-
–
tf.Tensor: Augmented tensor
Source code in neuralspot_edge/layers/preprocessing/frequency_mix_style.py
augment_samples
Augment samples
Parameters:
-
(inputsTensor) –Input tensor
Returns:
-
KerasTensor–tf.Tensor: Augmented tensor