tensorflow / tensorflow/probability

Adaptive step size and NUTS

Open
#983 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Jupyter Notebook
Stars
4.4k
Forks
1.1k
PR merge metrics
No merged PRs in 30d

Description

I am wondering what is the correct way to use samplers with adaptive step size with NUTS as the base sampler. The STS model notebook provides an example of such usage, but it seems to work in an undesired manner. For example, although the desired approximate acceptance rate is set to 0.75, during the sampling it is very close to 1. I tried to run longer adaptation/sampling, as well as several my own models with similar code for adaptation and it seems that at least DualAveragingStepSizeAdaptation severely underestimates the optimal leapfrog integration step size during the adaptation phase. With HMC sampler such misbehaviour does not manifest, so I suspect that the reason is that the NUTSKernelResults.log_accept_ratio quantity is not the one we need to pass for the log_accept_prob_getter_fn of DualAveragingStepSizeAdaptation. I tried to browse through the source codes to figure out what exactly is returned in NUTSKernelResults.log_accept_ratio, but this turned out quite challenging.

Could you please advice on what would be the correct way to adapt step size in NUTS?

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the STS approximate-inference notebook and trace how DualAveragingStepSizeAdaptation receives NUTSKernelResults.log_accept_ratio through log_accept_prob_getter_fn. Compare that path with the HMC sampler and inspect the relevant NUTS and adaptation source. Done means determining whether the reported acceptance quantity is appropriate and documenting or correcting the supported adaptation usage.

Written by the indexing model from the issue text.

Assessment

Tech stack
tensorflow
Domain
machine-learning
Issue type
Bug
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.