Skip to content

enhanced numeric stability for low prec. compute#43

Open
RsqM wants to merge 1 commit intobayeslabs:mainfrom
RsqM:numeric-stability
Open

enhanced numeric stability for low prec. compute#43
RsqM wants to merge 1 commit intobayeslabs:mainfrom
RsqM:numeric-stability

Conversation

@RsqM
Copy link

@RsqM RsqM commented Feb 26, 2025

Adding 1e-8 after division slightly shifts all outputs away from zero but doesn’t prevent division errors if sum_exp_x is exactly zero. Instead, adding it before division ensures sum_exp_x is never zero, avoiding potential division errors and preventing extreme values like inf or NaN, especially in low-precision computations

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.

1 participant