Potential numerical stability issue in current log cosh implementation? #384
Unanswered
YuhengZhi
asked this question in
Software Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, it looks like the current implementation of log(cosh(d)) is a concatenation of log and cosh. cosh could generate very large values even for modestly small d. Would it be better to go with log(cosh(d)) = d + log(1+e^(-2d)) - log(2)? I personally found sometimes loss becomes NaN once passed ~10^8, possibly due to this reason.
Beta Was this translation helpful? Give feedback.
All reactions