code: def test_training_loop_converges() -> None:
      m = create_model()
      mref = create_model()
      gpflow.optimizers.Scipy().minimize(
          mref.training_loss, mref.trainable_variables
      )
      training_loop(
          m.training_loss,
          tf.optimizers.Adam(learning_rate=0.01),
          m.trainable_variables,
          maxiter=5000,
          compile=True,
      )
      assert_models_close(m, mref, rtol=1e-5)
  
file_path: GPflow/tests/gpflow/utilities/test_training_loop.py
imports: from typing import Any
  import numpy
  import tensorflow
  from check_shapes import ShapeChecker
  import gpflow
  from gpflow.utilities import training_loop
label_desc: Use image node_id 4 for calling a global function with example usage: test_training_loop_converges() without return types