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

Sampling fails after init with advi+adapt_diag_grad #3965

Closed
fonnesbeck opened this issue Jun 15, 2020 · 0 comments · Fixed by #3979
Closed

Sampling fails after init with advi+adapt_diag_grad #3965

fonnesbeck opened this issue Jun 15, 2020 · 0 comments · Fixed by #3979

Comments

@fonnesbeck
Copy link
Member

When initializing a sample run with advi+adapt_diag_grad, the init runs without error, but when sampling starts it immediately fails. It appears the tune argument is not being passed from sample:

Traceback (most recent call last):
  File "/Users/cfonnesbeck/Repositories/pymc3/pymc3/parallel_sampling.py", line 128, in run
    self._start_loop()
  File "/Users/cfonnesbeck/Repositories/pymc3/pymc3/parallel_sampling.py", line 182, in _start_loop
    point, stats = self._compute_point()
  File "/Users/cfonnesbeck/Repositories/pymc3/pymc3/parallel_sampling.py", line 209, in _compute_point
    point, stats = self._step_method.step(self._point)
  File "/Users/cfonnesbeck/Repositories/pymc3/pymc3/step_methods/arraystep.py", line 263, in step
    apoint, stats = self.astep(array)
  File "/Users/cfonnesbeck/Repositories/pymc3/pymc3/step_methods/hmc/base_hmc.py", line 170, in astep
    self.potential.update(hmc_step.end.q, hmc_step.end.q_grad, self.tune)
  File "/Users/cfonnesbeck/Repositories/pymc3/pymc3/step_methods/hmc/quadpotential.py", line 310, in update
    super().update(sample, grad)
TypeError: update() missing 1 required positional argument: 'tune'

Here is the call:

    trace = pm.sample(1000, tune=3000, return_inferencedata=True, init='advi+adapt_diag_grad')

Running current master (3.9.0) on macOS and Python 3.8.

michaelosthege added a commit that referenced this issue Jun 23, 2020
michaelosthege added a commit that referenced this issue Jun 24, 2020
* add regression test for issue 3965
* pass on the tune argument to fix #3965

closes #3965
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

Successfully merging a pull request may close this issue.

1 participant