Skip to content

Bug in the new NUTS warning #2800

Closed
@junpenglao

Description

@junpenglao

Getting a lot of The chain reached the maximum tree depth. Increase max_treedepth, increase target_accept or reparameterize. and found the bug below:

https://github.com/pymc-devs/pymc3/blob/5eefc14b524378b1773d374004452b512523485a/pymc3/step_methods/hmc/nuts.py#L189

Since self._reached_max_treedepth is a non-negative integer this line will be true with 1 max_treedepth.
Changing it to something like if self._reached_max_treedepth/nsample > 0.05: should work, but I think the nsample information is not available? cc @aseyboldt

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions