Skip to content

Sampling fails after init with advi+adapt_diag_grad #3965

Closed
@fonnesbeck

Description

@fonnesbeck

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions