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

Method cwt_loss

tasks/tts/fs2.py:271–277  ·  view source on GitHub ↗
(self, cwt_p, cwt_g)

Source from the content-addressed store, hash-verified

269 return NotImplementedError
270
271 def cwt_loss(self, cwt_p, cwt_g):
272 if hparams['cwt_loss'] == 'l1':
273 return F.l1_loss(cwt_p, cwt_g)
274 if hparams['cwt_loss'] == 'l2':
275 return F.mse_loss(cwt_p, cwt_g)
276 if hparams['cwt_loss'] == 'ssim':
277 return self.ssim_loss(cwt_p, cwt_g, 20)
278
279 def add_energy_loss(self, energy_pred, energy, losses):
280 nonpadding = (energy != 0).float()

Callers 1

add_pitch_lossMethod · 0.95

Calls 2

ssim_lossMethod · 0.95
l1_lossMethod · 0.80

Tested by

no test coverage detected