Module: tfp.experimental.substrates.numpy.math

View source on GitHub

Numpy math.

Modules

generic module: Functions for generic calculations.

linalg module: Functions for common linear algebra operations.

numeric module: Numerically stable variants of common mathematical expressions.

Functions

fill_triangular(...): Creates a (batch of) triangular matrix from a vector of inputs.

fill_triangular_inverse(...): Creates a vector from a (batch of) triangular matrix.

log1psquare(...): Numerically stable calculation of log(1 + x**2) for small or large |x|.

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

log_combinations(...): Multinomial coefficient.

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

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