Missed TensorFlow Dev Summit? Check out the video playlist. Watch recordings

tf_agents.bandits.policies.linalg.conjugate_gradient

View source on GitHub

Returns x such that A * x = b.

tf_agents.bandits.policies.linalg.conjugate_gradient(
    a_mat, b, tol=1e-10
)

Implements the Conjugate Gradient method. https://en.wikipedia.org/wiki/Conjugate_gradient_method

Args:

  • a_mat: a Symmetric Positive Definite matrix, represented as a Tensor of shape [n, n].
  • b: a Tensor of shape [n, 1].
  • tol: (float) desired tolerance on the residual.

Returns:

  • x: Tensor x of shape [n, 1] such that A * x = b.

Raises:

  • ValueError: if a_mat is not square or a_mat and b have incompatible shapes.