Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tfp.math.log1mexp

View source on GitHub

Compute log(1 - exp(-|x|)) in a numerically stable way.

tfp.math.log1mexp(
    x, name=None
)

Args:

  • x: Float Tensor broadcastable with y.
  • name: Python str name prefixed to Ops created by this function. Default value: None (i.e., 'log1mexp').

Returns:

  • log1mexp: Float Tensor of log1mexp(a).

References

[1]: Machler, Martin. Accurately computing log(1 - exp(-|a|)) cran.r-project.org/web/packages/Rmpfr/vignettes/log1mexp-note.pdf