tfp.substrates.jax.math.log_sub_exp
Stay organized with collections
Save and categorize content based on your preferences.
Compute log(exp(max(x, y)) - exp(min(x, y)))
in a numerically stable way.
tfp.substrates.jax.math.log_sub_exp(
x, y, return_sign=False, name=None
)
Use return_sign=True
unless x >= y
, since we can't represent a negative in
log-space.
Args |
x
|
Float Tensor broadcastable with y .
|
y
|
Float Tensor broadcastable with x .
|
return_sign
|
Whether or not to return the second output value sign . If
it is known that x >= y , this is unnecessary.
|
name
|
Python str name prefixed to Ops created by this function.
Default value: None (i.e., 'log_sub_exp' ).
|
Returns |
logsubexp
|
Float Tensor of log(exp(max(x, y)) - exp(min(x, y))) .
|
sign
|
Float Tensor +/-1 indicating the sign of exp(x) - exp(y) .
|
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2023-11-21 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2023-11-21 UTC."],[],[]]