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

Add EPSILON to amp for numerical stability for division #907

Merged
merged 1 commit into from
Nov 18, 2024

Conversation

earthgecko
Copy link
Contributor

There are times when the amp does contain 0s. The addition of the EPSILON to amp prevents divide by zero being encountered and allows the algorithm to run and return results when the amp does contain 0s.

RuntimeWarning: divide by zero encountered in log
  log_amp = np.log(amp)
RuntimeWarning: invalid value encountered in subtract
  res_amp = log_amp - ma_log_amp

@CLAassistant
Copy link

CLAassistant commented Nov 15, 2024

CLA assistant check
All committers have signed the CLA.

Copy link
Collaborator

@RobertSamoilescu RobertSamoilescu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thank you for your contribution!

@RobertSamoilescu RobertSamoilescu merged commit 31d19a1 into SeldonIO:master Nov 18, 2024
10 of 20 checks 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.

3 participants