stan-dev / stan-dev/stan

Exposing mu to the services (stepsize warmup)

Open
#2,670 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

algorithm feature good first issue
Dominant language
C++
Stars
2.8k
Forks
388
Avg merge
2d 17h
Merged PRs (30d)
15

Description

Summary:

Regarding the parameters of the dual averaging optimization for the stepsize in the warmup, all parameters can be set by the user except mu. For certain models, the initial choice of mu can result in a drastic drop of the stepsize for subsequent iterations. This might lead to extra computation time. As mu is adjusted for each window of the mass matrix adjustment, this can in effect add a significant amount of computation time.

Description:

Currently, mu is set to be log(10 * this->nom_epsilon_) which is hardcoded in the algorithm, and the services stan::services::sample::hmc_static_dense_e_adapt, stan::services::sample::hmc_static_diag_e_adapt, stan::services::sample::hmc_nuts_dense_e_adapt and stan::services::sample::hmc_nuts_diag_e_adapt do not expose the factor of epsilon to the user. This issue would entail

  • updating the services API,
  • adding the factor as an attribute to stan::mcmc::stepsize_adaptation with the corresponding getter and setter and
  • updating the corresponding parts in stan::mcmc::adapt_dense_e_nuts, stan::mcmc::adapt_diag_e_nuts, stan::mcmc::adapt_dense_e_static_hmc and stan::mcmc::adapt_diag_e_static_hmc.

There are also the equivalent algorithms in nuts_classic, static_uniform and xhmc.

The default factor of 10 should be kept.

Additional Information:

Issues in Rstan, Pystan and CmdStan would have to be opened as well.

Current Version:

v2.18.0

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 by tracing the services hmc_static_dense_e_adapt, hmc_static_diag_e_adapt, hmc_nuts_dense_e_adapt, and hmc_nuts_diag_e_adapt into stepsize_adaptation and the listed adapt_* classes. Check the equivalent nuts_classic, static_uniform, and xhmc algorithms, then verify that the factor is exposed with a default of 10 across the affected APIs.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp
Domain
api, machine-learning
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.