-
Notifications
You must be signed in to change notification settings - Fork 1.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Hackathon 7th No.56] 在 PaddleSpeech 中复现 DAC 训练需要用到的 loss #3954
base: develop
Are you sure you want to change the base?
Conversation
Thanks for your contribution! |
In the original DAC repository, the training data is generated randomly. To assess accuracy, I sampled ten loss values and saved them in PyTorch tensor (.pt) format. The original repository showed no numerical errors, but in the Paddle implementation, bias is observed and I still tracing it . Here is the test result
|
With these patch, the new test result is below diff --git a/paddlespeech/t2s/modules/losses.py b/paddlespeech/t2s/modules/losses.py
index 029ad1be..ce5f441d 100644
--- a/paddlespeech/t2s/modules/losses.py
+++ b/paddlespeech/t2s/modules/losses.py
@@ -501,7 +502,7 @@ def stft(x,
real = x_stft.real()
imag = x_stft.imag()
- return paddle.sqrt(paddle.clip(real**2 + imag**2, min=1e-7)).transpose(
+ return paddle.clip(paddle.sqrt(real**2 + imag**2), min=clamp_eps).transpose(
[0, 2, 1])
@@ -930,7 +930,7 @@ class MelSpectrogram(nn.Layer):
real = real.transpose([0, 2, 1])
imag = imag.transpose([0, 2, 1])
x_power = real**2 + imag**2
- x_amp = paddle.sqrt(paddle.clip(x_power, min=self.eps))
+ x_amp = paddle.clip(paddle.sqrt(x_power), min=self.eps)
|
开发者你好,感谢你的参与!由于你的黑客松赛题完成度较高,其PR已被锁定,请尽快完善锁定的PR,并确保在2025年1月3日前完成合入。逾期未合入PR将无法获得奖金发放。 |
…ust the clipping threshold
…n calculation methods - Change precision threshold to ’1e-5‘ - Use relative error instead of absolute error
PR types
New features
PR changes
APIs
Describe