Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defaultn_adapts and discard_initial to zero #124

Closed
wants to merge 2 commits into from

Conversation

yebai
Copy link
Member

@yebai yebai commented Jul 29, 2023

Some downstream MCMC sampling package, e.g., AHMC, now assumes we always pass n_adapts to the AbstractMCMC.step function. It might be sensible to default these arguments to 0 when users didn't specify them to avoid missing n_adapts errors.

@yebai yebai requested a review from devmotion July 29, 2023 14:28
@codecov
Copy link

codecov bot commented Jul 29, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (d7c549f) 97.37% compared to head (8dc2dcf) 97.37%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #124   +/-   ##
=======================================
  Coverage   97.37%   97.37%           
=======================================
  Files           8        8           
  Lines         305      305           
=======================================
  Hits          297      297           
  Misses          8        8           
Files Changed Coverage Δ
src/sample.jl 96.64% <ø> (ø)

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -100,6 +100,7 @@ function mcmcsample(
progress=PROGRESS[],
progressname="Sampling",
callback=nothing,
n_adapts=0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

n_adapts is not a general thing (in contrast to discard_initial), so my feeling is this should not be specified in AbstractMCMC but downstream packages where it is relevant.

@@ -395,6 +399,8 @@ function mcmcsample(
::MCMCDistributed,
N::Integer,
nchains::Integer;
n_adapts=0,
discard_initial=0,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should not be needed - the keyword arguments are forwarded to the single-chain version and there a default of 0 is already specified.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The same is true for the other ensemble algorithms.

@yebai yebai marked this pull request as draft September 14, 2023 11:16
@yebai yebai closed this Oct 4, 2023
@yebai yebai deleted the hg/n_adapts-defaults branch October 4, 2023 13:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants