I have implemented the following GP model:
likelihood = gpflow.likelihoods.HeteroskedasticTFPConditional(
distribution_class=tfp.distributions.Normal, # Gaussian Likelihood
scale_transform=tfp.bijectors.Exp(), # Exponential Transform
)
lik = gpflow.likelihoods.SwitchedLikelihood([likelihood_orig, likelihood_orig])
coreg.W = np.random.rand(output_dim, rank) # Initialise the W matrix
kern = k1 * coreg
m = gpflow.models.VGP([X_augmented, Y_augmented], kernel=kern, likelihood=lik, num_latent_gps=1)
After optimization and training, when print the model summary: print_summary(m) All learnt parameters are shown except of the ones from the likelihood, I had expected to see a vector of variances and means. Model predict also throws an error:
xtest = np.linspace(0, 1, 100)[:, None]
line, = plt.plot(X1, Y1, 'x', mew=2)
mu, var = m.predict_f(np.hstack((xtest, np.zeros_like(xtest))))
And the error: tensorflow.python.framework.errors_impl.InvalidArgumentError: cannot compute Mul as input #1(zero-based) was expected to be a double tensor but is a float tensor [Op:Mul]
I believe the model has learnt heteroscedastic noise, but I am just unable to access it. I've also tried to access the parameters through m.trainable_parameters. But as before, no likelihood parameters are shown.
Can someone provide a hint where to look? (GPflow version 2.9.0)
Edit: The reason for using gpflow.likelihoods.HeteroskedasticTFPConditional() is that the goal is that each task learns its own noise model.