View source on GitHub |
Updates the inverse using the Woodbury matrix identity.
tf_agents.bandits.policies.linalg.update_inverse(
a_inv: tf_agents.typing.types.Float
,
x: tf_agents.typing.types.Float
) -> tf_agents.typing.types.Float
Given a matrix A
of size d-by-d and a matrix X
of size k-by-d, this
function computes the inverse of B = A + X^T X, assuming that the inverse of
A is available.
Reference:
https://en.wikipedia.org/wiki/Woodbury_matrix_identity
Args | |
---|---|
a_inv
|
a Tensor of shape [d , d ]. This is the current inverse of A .
|
x
|
a Tensor of shape [k , d ].
|
Returns | |
---|---|
The update that needs to be added to 'a_inv' to compute the inverse.
If x is empty, a zero matrix is returned.
|