PyTorch-based library for Riemannian Manifold Hamiltonian Monte Carlo (RMHMC) and inference in Bayesian neural networks
BSD 2-Clause "Simplified" License
426
stars
63
forks
source link
log_prob() with additional arguments #26
Open
aaschwanden opened 1 year ago
My log_prob function takes additional arguments besides variable $p$ that I want to estimate:
Is there a way to call hamiltorch.sample with additional arguments?
Calling
params_hmc = hamiltorch.sample(log_prob_func=log_prob, ...)
unsurprisingly results in
TypeError: log_prob() missing 2 required positional arguments: 'time' and 'obs'
as the documentation says
I've also tried
params_hmc = hamiltorch.sample(log_prob_func=log_prob(time, obs), ...)
and
params_hmc = hamiltorch.sample(log_prob_func=log_prob(time=time, obs=obs), ...)
both of which throw errors.