You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ng_vars = [[model_nat_grads.layers[-1].q_mu, model_nat_grads.layers[-1].q_sqrt]]
for v in ng_vars[0]:
v.set_trainable(False)
ng_action = NatGradOptimizer(gamma=1.).make_optimize_action(model_nat_grads, var_list=ng_vars)
adam_action = AdamOptimizer(0.001).make_optimize_action(model_nat_grads)
Loop([ng_action, adam_action], stop=iterations)()
Am I understanding correctly that the NatGradOptimizer ignores the set_trainable(False) whilst AdamOptimizer takes it into account? Is this because it acts at a lower level than GPFlow?
The text was updated successfully, but these errors were encountered:
The NatGradOptimizer optimizes only the variables in var_list, whereas all the tensorflow optimizers grab all variables with the trainable flag set to True. As you say, the NatGradOptimizer is a lower level implementation (it calls tf.assign directly, rather than let the tensorflow optimizer take care of it) as the update rule cannot be implemented through ordinary gradients.
Hi,
I refer to the code at https://github.com/ICL-SML/Doubly-Stochastic-DGP/blob/master/demos/using_natural_gradients.ipynb, specifically:
Am I understanding correctly that the NatGradOptimizer ignores the set_trainable(False) whilst AdamOptimizer takes it into account? Is this because it acts at a lower level than GPFlow?
The text was updated successfully, but these errors were encountered: