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

Method __init__

modules/parallel_wavegan/losses/stft_loss.py:79–87  ·  view source on GitHub ↗

Initialize STFT loss module.

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

Source from the content-addressed store, hash-verified

77 """STFT loss module."""
78
79 def __init__(self, fft_size=1024, shift_size=120, win_length=600, window="hann_window"):
80 """Initialize STFT loss module."""
81 super(STFTLoss, self).__init__()
82 self.fft_size = fft_size
83 self.shift_size = shift_size
84 self.win_length = win_length
85 self.window = getattr(torch, window)(win_length)
86 self.spectral_convergenge_loss = SpectralConvergengeLoss()
87 self.log_stft_magnitude_loss = LogSTFTMagnitudeLoss()
88
89 def forward(self, x, y):
90 """Calculate forward propagation.

Callers 3

__init__Method · 0.45
__init__Method · 0.45
__init__Method · 0.45

Calls 2

Tested by

no test coverage detected