spec_augment
SpecAugment Layer API
This module provides classes to build SpecAugment layers.
Classes:
-
SpecAugment2D
–SpecAugment 2D data
Classes
SpecAugment2D
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)
SpecAugment layer w/o time warping
Parameters:
-
freq_mask_param
(int
) –Frequency Mask Parameter (F in the paper)
-
time_mask_param
(int
) –Time Mask Parameter (T in the paper)
-
n_freq_mask
(int
, default:1
) –Number of frequency masks to apply (mF in the paper). Defaults to 1.
-
n_time_mask
(int
, default:1
) –Number of time masks to apply (mT in the paper). Defaults to 1.
-
mask_value
(float
, default:0.0
) –Imputation value. Defaults to zero.
Source code in neuralspot_edge/layers/preprocessing/spec_augment.py
Functions
call
Applies the SpecAugment operation to the input Mel Spectrogram
Parameters:
-
inputs
(KerasTensor
) –The input mel spectrogram
-
training
(bool
, default:None
) –Whether the model is training. Defaults to None.
Returns:
-
KerasTensor
–keras.KerasTensor: The mel spectrogram with the SpecAugment applied
Source code in neuralspot_edge/layers/preprocessing/spec_augment.py
get_config
Configuration to initialize the layer