mirror of https://github.com/coqui-ai/TTS.git
Update losses.py
Seems like in the latest dev merge, this change was reverted. Any specific reason for this? Without it the problem as stated here https://github.com/mozilla/TTS/issues/473 occurs.
This commit is contained in:
parent
af6f86252e
commit
47d74ced1c
|
@ -169,7 +169,7 @@ class GuidedAttentionLoss(torch.nn.Module):
|
|||
|
||||
@staticmethod
|
||||
def _make_ga_mask(ilen, olen, sigma):
|
||||
grid_x, grid_y = torch.meshgrid(torch.arange(olen), torch.arange(ilen))
|
||||
grid_x, grid_y = torch.meshgrid(torch.arange(olen, device=olen.device), torch.arange(ilen, device=ilen.device))
|
||||
grid_x, grid_y = grid_x.float(), grid_y.float()
|
||||
return 1.0 - torch.exp(-(grid_y / ilen - grid_x / olen)**2 /
|
||||
(2 * (sigma**2)))
|
||||
|
@ -306,4 +306,4 @@ class GlowTTSLoss(torch.nn.Module):
|
|||
return_dict['loss'] = log_mle + loss_dur
|
||||
return_dict['log_mle'] = log_mle
|
||||
return_dict['loss_dur'] = loss_dur
|
||||
return return_dict
|
||||
return return_dict
|
||||
|
|
Loading…
Reference in New Issue