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:
-
probability
float
, default:0.5
) –Probability of applying the augmentation.
-
alpha
float
, default:1.0
) –Mixup alpha value.
-
epsilon
float
, 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:
-
x
Tensor
) –Input tensor
-
lmda
Tensor
) –Lambda tensor
-
perm
Tensor
) –Permutation tensor
Returns:
-
–
tf.Tensor: Augmented tensor
Source code in neuralspot_edge/layers/preprocessing/frequency_mix_style.py
augment_samples
Augment samples
Parameters:
-
inputs
Tensor
) –Input tensor
Returns:
-
KerasTensor
–tf.Tensor: Augmented tensor