Skip to content

Commit

Permalink
allow fixed params in hmc
Browse files Browse the repository at this point in the history
  • Loading branch information
t-vi committed Nov 24, 2017
1 parent 4d19cc5 commit bd48929
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion candlegp/training/hmc.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def hmc_sample(model, num_samples, epsilon, lmin=1, lmax=2, thin=1, burn=0):

def logprob_grads():
logprob = -model.objective()
grads = torch.autograd.grad(logprob, model.parameters())
grads = torch.autograd.grad(logprob, [p for p in model.parameters() if p.requires_grad])
return logprob, grads

def thinning(thin_iterations, epsilon, lmin, lmax):
Expand Down

0 comments on commit bd48929

Please sign in to comment.