Module: tfp.experimental.substrates.numpy.math

TensorFlow Probability math functions.

Modules

deprecation module: Stub implementation of tensorflow.python.util.deprecation.

generic module: Functions for generic calculations.

gradient module: Functions for computing gradients.

interpolation module: Interpolation Ops.

linalg module: Functions for common linear algebra operations.

numeric module: Numerically stable variants of common mathematical expressions.

psd_kernels module: Positive-semidefinite kernels package.

root_search module: Methods for finding roots of functions of one variable.

special module: Implements special functions in TensorFlow.

Functions

batch_interp_regular_1d_grid(...): Linear 1-D interpolation on a regular (constant spacing) grid.

batch_interp_regular_nd_grid(...): Multi-linear interpolation on a regular (constant spacing) grid.

bessel_iv_ratio(...)

cholesky_concat(...): Concatenates chol @ chol.T with additional rows and columns.

cholesky_update(...): Returns cholesky of chol @ chol.T + multiplier * u @ u.T.

clip_by_value_preserve_gradient(...): Clips values to a specified min and max while leaving gradient unaltered.

custom_gradient(...): Embeds a custom gradient into a Tensor.

diag_jacobian(...): Computes diagonal of the Jacobian matrix of ys=fn(xs) wrt xs.

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.

interp_regular_1d_grid(...): Linear 1-D interpolation on a regular (constant spacing) grid.

lambertw(...)

lambertw_winitzki_approx(...): Computes Winitzki approximation to Lambert W function at z >= -1/exp(1).

lbeta(...): Returns log(Beta(x, y)).

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

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(...): Log multinomial coefficient.

log_cosh(...)

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

log_gamma_correction(...): Returns the error of the Stirling approximation to lgamma(x) for x >= 8.

log_gamma_difference(...): Returns lgamma(y) - lgamma(x + y), accurately.

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

lu_matrix_inverse(...): Computes a matrix inverse given the matrix's LU decomposition.

lu_reconstruct(...): The inverse LU decomposition, X == lu_reconstruct(*tf.linalg.lu(X)).

lu_solve(...): Solves systems of linear eqns A X = RHS, given LU factorizations.

pivoted_cholesky(...): Computes the (partial) pivoted cholesky decomposition of matrix.

random_rademacher(...): Generates Tensor consisting of -1 or +1, chosen uniformly at random.

random_rayleigh(...): Generates Tensor of positive reals drawn from a Rayleigh distributions.

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

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

remove_undocumented(...)

round_exponential_bump_function(...): Function supported on [-1, 1], smooth on the real line, with a round top.

scan_associative(...): Perform a scan with an associative binary operation, in parallel.

secant_root(...): Finds root(s) of a function of single variable using the secant method.

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)).

sparse_or_dense_matmul(...): Returns (batched) matmul of a SparseTensor (or Tensor) with a Tensor.

sparse_or_dense_matvecmul(...): Returns (batched) matmul of a (sparse) matrix with a column vector.

value_and_gradient(...): Computes f(*xs) and its gradients wrt to *xs.