Skip to content

Commit

Permalink
Sample ppc does not shuffle by default
Browse files Browse the repository at this point in the history
  • Loading branch information
ColCarroll committed Sep 26, 2018
1 parent bdd3dc0 commit 5574449
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions RELEASE-NOTES.md
Expand Up @@ -6,6 +6,7 @@

- Track the model log-likelihood as a sampler stat for NUTS and HMC samplers
(accessible as `trace.get_sampler_stats('model_logp')`) (#3134)
- Behavior of `sample_posterior_predictive` is now to produce posterior predictive samples in order from all values of the `trace`. Previously, by default it would produce 1 chain worth of samples, using a random selection from the `trace` (#3212)

### Maintenance

Expand Down
4 changes: 2 additions & 2 deletions pymc3/sampling.py
Expand Up @@ -1098,7 +1098,7 @@ def sample_posterior_predictive(trace, samples=None, model=None, vars=None, size
nchain = 1

if samples is None:
samples = len(trace)
samples = sum(len(v) for v in trace._straces.values())

model = modelcontext(model)

Expand All @@ -1108,7 +1108,7 @@ def sample_posterior_predictive(trace, samples=None, model=None, vars=None, size
if random_seed is not None:
np.random.seed(random_seed)

indices = np.random.randint(0, nchain * len_trace, samples)
indices = np.arange(samples)

if progressbar:
indices = tqdm(indices, total=samples)
Expand Down

0 comments on commit 5574449

Please sign in to comment.