Skip to content

Commit

Permalink
Change draws and tune defaults to 1000 in pm.sample (#3855)
Browse files Browse the repository at this point in the history
* Changed sampling defaults and cleaned typos

* Switched tune default to 1000

* Added release note

* Moved release note under Maintenance
  • Loading branch information
AlexAndorra committed Mar 30, 2020
1 parent e21191f commit 5a7680f
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 16 deletions.
3 changes: 2 additions & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
- Remove `sample_ppc` and `sample_ppc_w` that were deprecated in 3.6.
- Tuning results no longer leak into sequentially sampled `Metropolis` chains (see #3733 and #3796).
- Deprecated `sd` in version 3.7 has been replaced by `sigma` now raises `DepreciationWarning` on using `sd` in continuous, mixed and timeseries distributions. (see #3837 and #3688).
- In named models, `pm.Data` objects now get model-relative names (see [#3843](https://github.com/pymc-devs/pymc3/pull/3843))
- In named models, `pm.Data` objects now get model-relative names (see [#3843](https://github.com/pymc-devs/pymc3/pull/3843)).
- `pm.sample` now takes 1000 draws and 1000 tuning samples by default, instead of 500 previously (see [#3855](https://github.com/pymc-devs/pymc3/pull/3855)).

## PyMC3 3.8 (November 29 2019)

Expand Down
30 changes: 15 additions & 15 deletions pymc3/sampling.py
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ def _print_step_hierarchy(s, level=0):


def sample(
draws=500,
draws=1000,
step=None,
init="auto",
n_init=200000,
Expand All @@ -237,7 +237,7 @@ def sample(
chain_idx=0,
chains=None,
cores=None,
tune=500,
tune=1000,
progressbar=True,
model=None,
random_seed=None,
Expand All @@ -253,7 +253,7 @@ def sample(
Parameters
----------
draws: int
The number of samples to draw. Defaults to 500. The number of tuned samples are discarded
The number of samples to draw. Defaults to 1000. The number of tuned samples are discarded
by default. See ``discard_tuned_samples``.
init: str
Initialization method to use for auto-assigned NUTS samplers.
Expand Down Expand Up @@ -306,7 +306,7 @@ def sample(
The number of chains to run in parallel. If ``None``, set to the number of CPUs in the
system, but at most 4.
tune: int
Number of iterations to tune, defaults to 500. Samplers adjust the step sizes, scalings or
Number of iterations to tune, defaults to 1000. Samplers adjust the step sizes, scalings or
similar during tuning. Tuning samples will be drawn in addition to the number specified in
the ``draws`` argument, and will be discarded unless ``discard_tuned_samples`` is set to
False.
Expand Down Expand Up @@ -363,7 +363,7 @@ def sample(
>>> with pm.Model() as model: # context management
... p = pm.Beta('p', alpha=alpha, beta=beta)
... y = pm.Binomial('y', n=n, p=p, observed=h)
... trace = pm.sample(2000, tune=1000, cores=4)
... trace = pm.sample()
>>> pm.summary(trace)
mean sd mc_error hpd_2.5 hpd_97.5
p 0.604625 0.047086 0.00078 0.510498 0.694774
Expand Down Expand Up @@ -1104,10 +1104,10 @@ def step(self, tune_stop, population):


def _prepare_iter_population(
draws:int,
chains:list,
draws: int,
chains: list,
step,
start:list,
start: list,
parallelize:bool,
tune=None,
model=None,
Expand Down Expand Up @@ -1304,14 +1304,14 @@ def _choose_backend(trace, chain, shortcuts=None, **kwds):


def _mp_sample(
draws:int,
tune:int,
draws: int,
tune: int,
step,
chains:int,
cores:int,
chain:int,
random_seed:list,
start:list,
chains: int,
cores: int,
chain: int,
random_seed: list,
start: list,
progressbar=True,
trace=None,
model=None,
Expand Down

0 comments on commit 5a7680f

Please sign in to comment.