NVTabular icon indicating copy to clipboard operation
NVTabular copied to clipboard

[FEA] epsilon kwarg for LogOp and possible rename

Open benfred opened this issue 5 years ago • 2 comments

Issue by alecgunny Monday May 11, 2020 at 16:05 GMT Originally opened as https://github.com/rapidsai/recsys/issues/105


  1. Add eps kwarg to LogOp such that the math implemented is log(x+eps) instead of only log(x+1). I get the need for numeric stability but this might be confusing for some users who haven't read the source and expected log to just mean log, especially when they try to transform back to the original space (for e.g. metric calculation). Small values like 1e-7 could be useful to users who want "log-like" behavior but still need numeric stability.

  2. LogOp is the only Op that has "Op" in its name. Might be worth just calling Log for consistency.

benfred avatar Jun 04 '20 23:06 benfred

Comment by benfred Monday May 11, 2020 at 16:13 GMT


+1 to both of these

benfred avatar Jun 04 '20 23:06 benfred

Additional motivation: Numerically stable implementations of certain losses require working in log space, and making use of standard operations like torch.logsumexp (for example). In the current form,

  1. If a user is unaware of the name inconsistency, they'll get incorrect results.

  2. Even if a user is aware of this inconsistency, forming numerically stable implementations becomes difficult: we first need to essentially invert the 'add 1 and take log op` before we proceed.

rdipietro avatar Jun 09 '20 15:06 rdipietro