espnet2.tts.prodiff.loss.gaussian
Less than 1 minute
espnet2.tts.prodiff.loss.gaussian
espnet2.tts.prodiff.loss.gaussian(window_size: int, sigma: float) → Tensor
Gaussian Noise generation function.
This function generates a Gaussian noise tensor based on the specified window size and sigma. The resulting tensor can be used for various applications such as data augmentation or simulating noise in signal processing tasks.
- Parameters:
- window_size (int) – The size of the window for the Gaussian function.
- sigma (float) – The standard deviation of the Gaussian distribution.
- Returns: A normalized tensor representing Gaussian noise.
- Return type: torch.Tensor
Examples
>>> noise = gaussian(window_size=5, sigma=1.0)
>>> print(noise)
tensor([0.0585, 0.2419, 0.3879, 0.2419, 0.0585])
NOTE
The generated Gaussian noise is normalized such that the sum of the tensor elements equals 1.