Skip to content
This repository has been archived by the owner on Dec 18, 2023. It is now read-only.

Robust U-turn condition #864

Closed
wants to merge 2 commits into from
Closed

Robust U-turn condition #864

wants to merge 2 commits into from

Conversation

horizon-blue
Copy link
Contributor

Summary:
An issue with the U-turn condition was discovered and discussed in this post in Stan forum

TL;DR: we can make the U-turn condition more robust by introducing two additional checks across subtrees. This can help us avoid missing U-turns for approximately iid normal models.

{F619223264}

Since the tree combining code are almost identical in _build_tree and propose, I also take the chance to refactor them into a common function called _combine_tree. If you look closely you will notice that most part of _combine_tree are moved from existing code as-is. The only addition is the two additional call to _is_u_turning

Related PR that implements this change:

Differential Revision: D28735950

Differential Revision: D28817142

fbshipit-source-id: dcb24b691458663007831f5fc16686d60f0ddd27
Summary:
An issue with the U-turn condition was discovered and discussed in [this post in Stan forum](https://discourse.mc-stan.org/t/nuts-misses-u-turns-runs-in-circles-until-max-treedepth/9727)

TL;DR: we can make the U-turn condition more robust by introducing two additional checks across subtrees. This can help us avoid missing U-turns for approximately iid normal models.

{F619223264}

Since the tree combining code are almost identical in `_build_tree` and `propose`, I also take the chance to refactor them into a common function called `_combine_tree`. If you look closely you will notice that most part of `_combine_tree` are moved from existing code as-is. The only addition is the two additional call to `_is_u_turning`

Related PR that implements this change:
- Stan: stan-dev/stan#2800
- PyMC3: pymc-devs/pymc#3605
- Turing.jl: TuringLang/AdvancedHMC.jl#207
- DynamicHMC.jl: tpapp/DynamicHMC.jl#145

Differential Revision: D28735950

fbshipit-source-id: 54d60ae038d85331e3cdefec73848c2107075c2f
@facebook-github-bot facebook-github-bot added CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported labels Jun 4, 2021
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D28735950

@facebook-github-bot
Copy link
Contributor

This pull request has been merged in 518cab7.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants