tfp.substrates.numpy.math.pivoted_cholesky
Stay organized with collections
Save and categorize content based on your preferences.
Computes the (partial) pivoted cholesky decomposition of matrix
.
tfp.substrates.numpy.math.pivoted_cholesky(
matrix, max_rank, diag_rtol=0.001, return_pivoting_order=False, name=None
)
The pivoted Cholesky is a low rank approximation of the Cholesky decomposition
of matrix
, i.e. as described in [(Harbrecht et al., 2012)][1]. The
currently-worst-approximated diagonal element is selected as the pivot at each
iteration. This yields from a [B1...Bn, N, N]
shaped matrix
a [B1...Bn,
N, K]
shaped rank-K
approximation lr
such that lr @ lr.T ~= matrix
.
Note that, unlike the Cholesky decomposition, lr
is not triangular even in
a rectangular-matrix sense. However, under a permutation it could be made
triangular (it has one more zero in each column as you move to the right).
Such a matrix can be useful as a preconditioner for conjugate gradient
optimization, i.e. as in [(Wang et al. 2019)][2], as matmuls and solves can be
cheaply done via the Woodbury matrix identity, as implemented by
tf.linalg.LinearOperatorLowRankUpdate
.
Args |
matrix
|
Floating point Tensor batch of symmetric, positive definite
matrices.
|
max_rank
|
Scalar int Tensor , the rank at which to truncate the
approximation.
|
diag_rtol
|
Scalar floating point Tensor (same dtype as matrix ). If the
errors of all diagonal elements of lr @ lr.T are each lower than
element * diag_rtol , iteration is permitted to terminate early.
|
return_pivoting_order
|
If True , return an int Tensor indicating the
pivoting order used to produce lr (in addition to lr ).
|
name
|
Optional name for the op.
|
Returns |
lr
|
Low rank pivoted Cholesky approximation of matrix .
|
perm
|
(Optional) pivoting order used to produce lr .
|
References
[1]: H Harbrecht, M Peters, R Schneider. On the low-rank approximation by the
pivoted Cholesky decomposition. Applied numerical mathematics,
62(4):428-440, 2012.
[2]: K. A. Wang et al. Exact Gaussian Processes on a Million Data Points.
arXiv preprint arXiv:1903.08114, 2019. https://arxiv.org/abs/1903.08114
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."],[],[],null,["# tfp.substrates.numpy.math.pivoted_cholesky\n\n\u003cbr /\u003e\n\n|--------------------------------------------------------------------------------------------------------------------------------------------------|\n| [View source on GitHub](https://github.com/tensorflow/probability/blob/v0.23.0/tensorflow_probability/substrates/numpy/math/linalg.py#L268-L419) |\n\nComputes the (partial) pivoted cholesky decomposition of `matrix`.\n\n#### View aliases\n\n\n**Main aliases**\n\n[`tfp.experimental.substrates.numpy.math.pivoted_cholesky`](https://www.tensorflow.org/probability/api_docs/python/tfp/substrates/numpy/math/pivoted_cholesky)\n\n\u003cbr /\u003e\n\n tfp.substrates.numpy.math.pivoted_cholesky(\n matrix, max_rank, diag_rtol=0.001, return_pivoting_order=False, name=None\n )\n\nThe pivoted Cholesky is a low rank approximation of the Cholesky decomposition\nof `matrix`, i.e. as described in \\[(Harbrecht et al., 2012)\\]\\[1\\]. The\ncurrently-worst-approximated diagonal element is selected as the pivot at each\niteration. This yields from a `[B1...Bn, N, N]` shaped `matrix` a `[B1...Bn,\nN, K]` shaped rank-`K` approximation `lr` such that `lr @ lr.T ~= matrix`.\nNote that, unlike the Cholesky decomposition, `lr` is not triangular even in\na rectangular-matrix sense. However, under a permutation it could be made\ntriangular (it has one more zero in each column as you move to the right).\n\nSuch a matrix can be useful as a preconditioner for conjugate gradient\noptimization, i.e. as in \\[(Wang et al. 2019)\\]\\[2\\], as matmuls and solves can be\ncheaply done via the Woodbury matrix identity, as implemented by\n[`tf.linalg.LinearOperatorLowRankUpdate`](https://www.tensorflow.org/api_docs/python/tf/linalg/LinearOperatorLowRankUpdate).\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Args ---- ||\n|-------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|\n| `matrix` | Floating point `Tensor` batch of symmetric, positive definite matrices. |\n| `max_rank` | Scalar `int` `Tensor`, the rank at which to truncate the approximation. |\n| `diag_rtol` | Scalar floating point `Tensor` (same dtype as `matrix`). If the errors of all diagonal elements of `lr @ lr.T` are each lower than `element * diag_rtol`, iteration is permitted to terminate early. |\n| `return_pivoting_order` | If `True`, return an `int` `Tensor` indicating the pivoting order used to produce `lr` (in addition to `lr`). |\n| `name` | Optional name for the op. |\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n\u003cbr /\u003e\n\n| Returns ------- ||\n|--------|------------------------------------------------------|\n| `lr` | Low rank pivoted Cholesky approximation of `matrix`. |\n| `perm` | (Optional) pivoting order used to produce `lr`. |\n\n\u003cbr /\u003e\n\n#### References\n\n\\[1\\]: H Harbrecht, M Peters, R Schneider. On the low-rank approximation by the\npivoted Cholesky decomposition. *Applied numerical mathematics*,\n62(4):428-440, 2012.\n\n\\[2\\]: K. A. Wang et al. Exact Gaussian Processes on a Million Data Points.\n*arXiv preprint arXiv:1903.08114* , 2019. \u003chttps://arxiv.org/abs/1903.08114\u003e"]]