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

Enabling algorithm-specific default num_adaptive_samples #1353

Closed

Conversation

horizon-blue
Copy link
Contributor

Summary:
The number of adaptive samples for all algorithm is set to 0 by default, which is okay for algorithms like ancestral MH or NMC, but not for HMC and NUTS. Per our previous discussion, instead of using the same default value for all algorithms, a better solution is to let each algorithm determine how many adaptive iterations are necessary. For compositional inference, it will look up the number of adaptive samples required by each inference method in the config and default to the maximum among them (see Option 3 in Warmup Design for details).

This diff implement this idea by introducing a _get_default_num_adaptive_samples private method on BaseInference, which is default to 0. Algorithms can override the default behavior by overloading the method.

Differential Revision: D34404061

Summary:
The number of adaptive samples for all algorithm is set to 0 by default, which is okay for algorithms like ancestral MH or NMC, but not for HMC and NUTS. Per our previous discussion, instead of using the same default value for all algorithms, a better solution is to let each algorithm determine how many adaptive iterations are necessary. For compositional inference, it will look up the number of adaptive samples required by each inference method in the config and default to the maximum among them (see [Option 3 in Warmup Design](https://fb.quip.com/jzFvAai8ogWV#temp:C:WMIc97e2ffd843b4ab19bbe40c7c) for details).

This diff implement this idea by introducing a `_get_default_num_adaptive_samples` private method on `BaseInference`, which is default to 0. Algorithms can override the default behavior by overloading the method.

Differential Revision: D34404061

fbshipit-source-id: 5c073abb3abb993cf96ba5ef13e0923e859e6b09
@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 Feb 23, 2022
@facebook-github-bot
Copy link
Contributor

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

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants