# tf_agents.bandits.policies.linalg.simplified_woodbury_update

<br />

|---|
| [![](https://www.tensorflow.org/images/GitHub-Mark-32px.png) View source on GitHub](https://github.com/tensorflow/agents/blob/v0.19.0/tf_agents/bandits/policies/linalg.py#L130-L160) |

Returns `w` such that `inverse(a + u.T.dot(u)) = a_inv + w`.

    tf_agents.bandits.policies.linalg.simplified_woodbury_update(
        a_inv: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/Float,
        u: https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/Float
    ) -> https://www.tensorflow.org/agents/api_docs/python/tf_agents/typing/types/Float

Makes use of the Woodbury matrix identity. See
<https://en.wikipedia.org/wiki/Woodbury_matrix_identity>

> [!NOTE]
> **Note:** This implementation assumes that a_inv is symmetric. Since it's too expensive to check symmetricity, the function silently outputs a wrong answer in case `a` is not symmetric.

<br />

<br />

<br />

| ## Args ||
|---|---|
| `a_inv` | an invertible SYMMETRIC `Tensor` of shape `[m, m]`. |
| `u` | a `Tensor` of shape `[n, m]`. |

<br />

<br />

<br />

<br />

| ## Returns ||
|---|---|
| A `Tensor` `w` of shape `[m, m]` such that `inverse(a + u.T.dot(u)) = a_inv + w`. ||

<br />

<br />

<br />

<br />

| ## Raises ||
|---|---|
| `ValueError` | if `a_inv` is not square or `a_inv` and `u` have incompatible shapes. |

<br />