code: def test_conjugate_gradient_convergence() -> None:
      """
      Check that the method of conjugate gradients implemented can solve a linear system of equations
      """
      rng: np.random.RandomState = np.random.RandomState(999)
      noise = 1e-3
      train, z, _ = data(rng)
      x, y = train
      n = x.shape[0]
      b = tf.transpose(y)
      k = SquaredExponential()
      K = k(x) + noise * tf.eye(n, dtype=default_float())
      Kinv_y = tf.linalg.solve(
          K, y
      )  # We could solve by cholesky instead
  
      model = CGLB(
          (x, y), kernel=k, inducing_variable=z, noise_variance=noise
      )
      common = model._common_calculation()
  
      initial = tf.zeros_like(b)
      A = common.A
      LB = common.LB
      max_error = 0.01
      max_steps = 200
      restart_cg_step = 200
      preconditioner = NystromPreconditioner(A, LB, noise)
  
      v = cglb_conjugate_gradient(
          K,
          b,
          initial,
          preconditioner,
          max_error,
          max_steps,
          restart_cg_step,
      )
  
      # NOTE: with smaller `max_error` we can reduce the `rtol`
      np.testing.assert_allclose(Kinv_y, tf.transpose(v), rtol=0.1)
  
file_path: GPflow/tests/gpflow/models/test_cglb.py
imports: from typing import Tuple, cast
  import numpy
  import tensorflow
  from check_shapes import check_shapes
  from gpflow.base import AnyNDArray, RegressionData
  from gpflow.config import default_float
  from gpflow.kernels import SquaredExponential
  from gpflow.models import CGLB, GPR, SGPR
  from gpflow.models.cglb import NystromPreconditioner, cglb_conjugate_gradient
  from gpflow.utilities import to_default_float
label_desc: Use image node_id 3 for calling a global function with example usage: test_conjugate_gradient_convergence() without return types