MCPcopy Create free account
hub / github.com/MoonInTheRiver/DiffSinger / __init__

Method __init__

modules/parallel_wavegan/stft_loss.py:16–27  ·  view source on GitHub ↗

Initialize STFT loss module.

(self, fft_size=1024, shift_size=120, win_length=600, window="hann_window",
                 use_mel_loss=False)

Source from the content-addressed store, hash-verified

14 """STFT loss module."""
15
16 def __init__(self, fft_size=1024, shift_size=120, win_length=600, window="hann_window",
17 use_mel_loss=False):
18 """Initialize STFT loss module."""
19 super(STFTLoss, self).__init__()
20 self.fft_size = fft_size
21 self.shift_size = shift_size
22 self.win_length = win_length
23 self.window = getattr(torch, window)(win_length)
24 self.spectral_convergenge_loss = SpectralConvergengeLoss()
25 self.log_stft_magnitude_loss = LogSTFTMagnitudeLoss()
26 self.use_mel_loss = use_mel_loss
27 self.mel_basis = None
28
29 def forward(self, x, y):
30 """Calculate forward propagation.

Callers 1

__init__Method · 0.45

Calls 2

Tested by

no test coverage detected