code: def test_bayesian_gplvm_2d() -> None:
      Q = 2  # latent dimensions
      X_data_mean = pca_reduce(Data.Y, Q)
      kernel = gpflow.kernels.SquaredExponential()
  
      m = gpflow.models.BayesianGPLVM(
          Data.Y,
          X_data_mean,
          np.ones((Data.N, Q)),
          kernel,
          num_inducing_variables=Data.M,
      )
  
      elbo_initial = m.elbo()
      opt = gpflow.optimizers.Scipy()
      opt.minimize(
          m.training_loss,
          m.trainable_variables,
          options=dict(maxiter=2),
      )
      assert m.elbo() > elbo_initial
  
      # test prediction
      Xtest = Data.rng.randn(10, Q)
      mu_f, var_f = m.predict_f(Xtest)
      mu_fFull, var_fFull = m.predict_f(Xtest, full_cov=True)
      np.testing.assert_allclose(mu_fFull, mu_f)
  
      for i in range(Data.D):
          np.testing.assert_allclose(
              var_f[:, i], np.diag(var_fFull[i, :, :])
          )
  
file_path: GPflow/tests/gpflow/models/test_gplvm.py
imports: from typing import Optional
  import numpy
  import pytest
  import gpflow
  from gpflow.utilities.ops import pca_reduce
label_desc: Use image node_id 3 for calling a global function with example usage: test_bayesian_gplvm_2d() without return types