TensorFlow 2.0 Beta is available Learn more

Module: tfp.math

TensorFlow Probability math functions.

Defined in python/math/__init__.py.

Modules

ode module: TensorFlow Probability ODE solvers.

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.

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

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.

dense_to_sparse(...): Converts dense Tensor to SparseTensor, dropping ignore_value cells.

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

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

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

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.

matrix_rank(...): Compute the matrix rank; the number of non-zero SVD singular values.

pinv(...): Compute the Moore-Penrose pseudo-inverse of a matrix.

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.

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

soft_threshold(...): Soft Thresholding operator.

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.