Skip to content
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

Fixing EPS application when applying sqrt #14

Merged
merged 1 commit into from
Sep 25, 2024

Conversation

FedericoDiMarzo
Copy link
Contributor

Problem

  • When using the pytorch_stoi loss in some training sessions some NaN values are were appearing
  • One of the possible cause would be related to the sqrt operation since the gradient will lead to a singularity
  • An EPS is applied in the current implementation but the order of the operations can allow for exploding gradients

Solution

  • Sum EPS just before applying sqrt

@mpariente
Copy link
Owner

Thanks, that's perfect !

@mpariente mpariente merged commit 2943ec2 into mpariente:master Sep 25, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants