[go: nahoru, domu]

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

Migrate MCMC notebook to gpflow2.0 #1100

Merged
merged 24 commits into from
Nov 13, 2019
Merged
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
test the wrapped closure
  • Loading branch information
Eric Hambro committed Nov 13, 2019
commit 0db2ea0236a9f1440a3fdb27218f7e2a7989ecb9
5 changes: 5 additions & 0 deletions tests/test_mcmc_helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ def test_mcmc_helper_target_function():

assert model.log_marginal_likelihood() == target_log_prob_fn()

# test the wrapped closure
log_prob, grad_fn = target_log_prob_fn.__original_wrapped__()
grad, nones = grad_fn(1, [None] * len(model.trainable_parameters))
assert len(grad) == len(model.trainable_parameters)
assert nones == [None] * len(model.trainable_parameters)

def test_mcmc_sampler_integration():
data = build_data()
Expand Down