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

how to solve the issue of overflow #2

Open
ZGCTroy opened this issue Jul 26, 2023 · 0 comments
Open

how to solve the issue of overflow #2

ZGCTroy opened this issue Jul 26, 2023 · 0 comments

Comments

@ZGCTroy
Copy link

ZGCTroy commented Jul 26, 2023

when x_i is large, torch.exp(x_i) will overflow.

In your implementation, x_i = x_i - x_max. So the softmax one equation should be exp(x_i - x_max) / (1 + sum(exp(x_i - x_max)) ?

Upvote & Fund

  • We're using Polar.sh so you can upvote and help fund this issue.
  • We receive the funding once the issue is completed & confirmed by you.
  • Thank you in advance for helping prioritize & fund our backlog.
Fund with Polar
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

No branches or pull requests

1 participant