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

Method l1_loss

tasks/tts/fs2.py:158–164  ·  view source on GitHub ↗
(self, decoder_output, target)

Source from the content-addressed store, hash-verified

156 raise NotImplementedError
157
158 def l1_loss(self, decoder_output, target):
159 # decoder_output : B x T x n_mel
160 # target : B x T x n_mel
161 l1_loss = F.l1_loss(decoder_output, target, reduction='none')
162 weights = self.weights_nonzero_speech(target)
163 l1_loss = (l1_loss * weights).sum() / weights.sum()
164 return l1_loss
165
166 def ssim_loss(self, decoder_output, target, bias=6.0):
167 # decoder_output : B x T x n_mel

Callers 4

add_mel_lossMethod · 0.95
forwardMethod · 0.80
add_pitch_lossMethod · 0.80
cwt_lossMethod · 0.80

Calls 1

Tested by

no test coverage detected