Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Read Values of the optimization parameters after training #25

Open
Hebbalali opened this issue Jul 3, 2018 · 3 comments
Open

Read Values of the optimization parameters after training #25

Hebbalali opened this issue Jul 3, 2018 · 3 comments

Comments

@Hebbalali
Copy link

Hello,
I have noticed that after training the DGP and using the command model.read_values() that it returns the same values as before the training. While the model has been correctly trained, in fact model.compute_log_likelihood() has been decreased before and after while the parameters remained the same. So i think that probably model.read_values() is not the correct function to read the values after the optimization?
Thank you in advance for clarifying this question !
Ali

@hughsalimbeni
Copy link
Collaborator

Are you referring to the variational parameters q_mu and q_sqrt or the hyperparameters? One problem I've had is that the variational parameter numpy arrays don't get updated when using natural gradients (as they have the trainable flag as False). The other parameters should be working though. Could you provide an example?

In the mean time, though, running the tensorflow variable should always work. E.g.

sess = model.enquire_session()  # get the current session 
print(sess.run(model.p.constrained_tensor))  # prints the value of parameter p

@Hebbalali
Copy link
Author

To read the values of the parameters i used as in gpflow model.read_values or model.as_pandas_table. However, for ALL the trainable parameters the values printed do not change befor and after the training. But, by runing the tensorflow variable as you suggested print(sess.run(model.p.constrained_tensor)) the true values of the parameters after training are printed.

@hughsalimbeni
Copy link
Collaborator

I've never actually used .read_values before, I've always just done print(model). Do you get the same issue for a vanilla gpflow model, e.g. SVGP? Also, can I check which version of gpflow you're using?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants