Skip to content

Commit 5a7680f

Browse files
authored
Change draws and tune defaults to 1000 in pm.sample (#3855)
* Changed sampling defaults and cleaned typos * Switched tune default to 1000 * Added release note * Moved release note under Maintenance
1 parent e21191f commit 5a7680f

File tree

2 files changed

+17
-16
lines changed

2 files changed

+17
-16
lines changed

Diff for: RELEASE-NOTES.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@
1616
- Remove `sample_ppc` and `sample_ppc_w` that were deprecated in 3.6.
1717
- Tuning results no longer leak into sequentially sampled `Metropolis` chains (see #3733 and #3796).
1818
- 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).
19-
- In named models, `pm.Data` objects now get model-relative names (see [#3843](https://github.com/pymc-devs/pymc3/pull/3843))
19+
- In named models, `pm.Data` objects now get model-relative names (see [#3843](https://github.com/pymc-devs/pymc3/pull/3843)).
20+
- `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)).
2021

2122
## PyMC3 3.8 (November 29 2019)
2223

Diff for: pymc3/sampling.py

+15-15
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ def _print_step_hierarchy(s, level=0):
228228

229229

230230
def sample(
231-
draws=500,
231+
draws=1000,
232232
step=None,
233233
init="auto",
234234
n_init=200000,
@@ -237,7 +237,7 @@ def sample(
237237
chain_idx=0,
238238
chains=None,
239239
cores=None,
240-
tune=500,
240+
tune=1000,
241241
progressbar=True,
242242
model=None,
243243
random_seed=None,
@@ -253,7 +253,7 @@ def sample(
253253
Parameters
254254
----------
255255
draws: int
256-
The number of samples to draw. Defaults to 500. The number of tuned samples are discarded
256+
The number of samples to draw. Defaults to 1000. The number of tuned samples are discarded
257257
by default. See ``discard_tuned_samples``.
258258
init: str
259259
Initialization method to use for auto-assigned NUTS samplers.
@@ -306,7 +306,7 @@ def sample(
306306
The number of chains to run in parallel. If ``None``, set to the number of CPUs in the
307307
system, but at most 4.
308308
tune: int
309-
Number of iterations to tune, defaults to 500. Samplers adjust the step sizes, scalings or
309+
Number of iterations to tune, defaults to 1000. Samplers adjust the step sizes, scalings or
310310
similar during tuning. Tuning samples will be drawn in addition to the number specified in
311311
the ``draws`` argument, and will be discarded unless ``discard_tuned_samples`` is set to
312312
False.
@@ -363,7 +363,7 @@ def sample(
363363
>>> with pm.Model() as model: # context management
364364
... p = pm.Beta('p', alpha=alpha, beta=beta)
365365
... y = pm.Binomial('y', n=n, p=p, observed=h)
366-
... trace = pm.sample(2000, tune=1000, cores=4)
366+
... trace = pm.sample()
367367
>>> pm.summary(trace)
368368
mean sd mc_error hpd_2.5 hpd_97.5
369369
p 0.604625 0.047086 0.00078 0.510498 0.694774
@@ -1104,10 +1104,10 @@ def step(self, tune_stop, population):
11041104

11051105

11061106
def _prepare_iter_population(
1107-
draws:int,
1108-
chains:list,
1107+
draws: int,
1108+
chains: list,
11091109
step,
1110-
start:list,
1110+
start: list,
11111111
parallelize:bool,
11121112
tune=None,
11131113
model=None,
@@ -1304,14 +1304,14 @@ def _choose_backend(trace, chain, shortcuts=None, **kwds):
13041304

13051305

13061306
def _mp_sample(
1307-
draws:int,
1308-
tune:int,
1307+
draws: int,
1308+
tune: int,
13091309
step,
1310-
chains:int,
1311-
cores:int,
1312-
chain:int,
1313-
random_seed:list,
1314-
start:list,
1310+
chains: int,
1311+
cores: int,
1312+
chain: int,
1313+
random_seed: list,
1314+
start: list,
13151315
progressbar=True,
13161316
trace=None,
13171317
model=None,

0 commit comments

Comments
 (0)