code: def run_adam(model, iterations):
      """
      Utility function running the Adam optimizer
  
      :param model: GPflow model
      :param interations: number of iterations
      """
      # Create an Adam Optimizer action
      logf = []
      train_iter = iter(train_dataset.batch(minibatch_size))
      training_loss = model.training_loss_closure(
          train_iter, compile=True
      )
      optimizer = tf.optimizers.Adam()
  
      @tf.function
      def optimization_step():
          optimizer.minimize(training_loss, model.trainable_variables)
  
      for step in range(iterations):
          optimization_step()
          if step % 10 == 0:
              elbo = -training_loss().numpy()
              logf.append(elbo)
      return logf
  
file_path: GPflow/notebooks/advanced/gps_for_big_data.pct.py
imports: import itertools
  import time
  import matplotlib.pyplot
  import numpy
  import tensorflow
  import gpflow
  from gpflow.ci_utils import reduce_in_tests
label_desc: Use image node_id 3 for calling a global function with example usage: run_adam(model, iterations) and returns: logf