Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
hrnoh24 committed Jul 30, 2024
2 parents 6e890c9 + 581bf51 commit faa629f
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/models/losses/mel_loss.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ def forward(self, audio):
win_length=self.win_length,
window=self.window,
center=False,
return_complex=False,
return_complex=True,
)
real_part, imag_part = fft.unbind(-1)
magnitude = torch.sqrt(real_part ** 2 + imag_part ** 2)
magnitude = torch.abs(fft)
mel_output = torch.matmul(self.mel_basis, magnitude)
log_mel_spec = torch.log10(torch.clamp(mel_output, min=1e-5))

return log_mel_spec

class ReconstructionLoss(nn.Module):
Expand Down

0 comments on commit faa629f

Please sign in to comment.