mirror of
https://github.com/wassname/TTS.git
synced 2026-10-27 12:30:27 +08:00
bug fix loss
This commit is contained in:
1 parent
52b4bc6bed
commit
e257bd7278
1 file changed
+2
-1
+2
-1
@@ -44,10 +44,11 @@ class L1LossMasked(nn.Module):
|
||||
# target_flat: (batch * max_len, dim)
|
||||
target_flat = target.view(-1, target.shape[-1])
|
||||
# losses_flat: (batch * max_len, dim)
|
||||
losses_flat = functional.l1_loss(input, target, size_average=False,
|
||||
losses_flat = functional.l1_loss(input, target_flat, size_average=False,
|
||||
reduce=False)
|
||||
# losses: (batch, max_len, dim)
|
||||
losses = losses_flat.view(*target.size())
|
||||
|
||||
# mask: (batch, max_len, 1)
|
||||
mask = _sequence_mask(sequence_length=length,
|
||||
max_len=target.size(1)).unsqueeze(2)
|
||||
|
||||
Reference in new issue
Block a user