Module: tfp.experimental.substrates.numpy.math.generic

Functions for generic calculations.

Functions

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

log_add_exp(...): Computes log(exp(x) + exp(y)) in a numerically stable way.

log_combinations(...): Log multinomial coefficient.

log_cosh(...)

log_cumsum_exp(...): Computes log(cumsum(exp(x))).

log_sub_exp(...): Compute log(exp(max(x, y)) - exp(min(x, y))) in a numerically stable way.

reduce_logmeanexp(...): Computes log(mean(exp(input_tensor))).

reduce_weighted_logsumexp(...): Computes log(abs(sum(weight * exp(elements across tensor dimensions)))).

smootherstep(...): Computes a sigmoid-like interpolation function on the unit-interval.

soft_sorting_matrix(...): Computes a matrix representing a continuous relaxation of sorting.

soft_threshold(...): Soft Thresholding operator.

softplus_inverse(...): Computes the inverse softplus, i.e., x = softplus_inverse(softplus(x)).