freq_mask
chronax.freq_mask
A utility function for applying frequency domain masking (spectral regularization) to time series data. It concatenates two input tensors (x and y), transforms them to the frequency domain using RFFT, randomly zeroes out frequencies based on the specified rate, and then transforms the data back using iRFFT before splitting it back into the original segments.
freq_mask(x, y, rate=0.1, dim=1)
Applies frequency masking to the concatenated input tensors x and y.
| Parameter | Type | Default | Description |
|---|---|---|---|
x |
- | - | The input tensor representing the past segment. |
y |
- | - | The input tensor representing the future segment. |
rate |
float |
0.1 |
The probability rate for randomly selecting frequencies to be zeroed out. |
dim |
int |
1 |
The dimension along which the FFT operations are performed. |
Returns: tuple
A tuple containing the reconstructed x and y tensors after frequency masking and inverse FFT.