Navigation Menu

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

Sample ppc does not shuffle by default #3212

Merged
merged 2 commits into from Oct 7, 2018

Conversation

ColCarroll
Copy link
Member

Fixes #3208.

This makes default sample_posterior_predictive behavior to sample from the trace in order, and not shuffle it. It was a smaller change than expected.

@@ -1126,9 +1126,9 @@ def sample_posterior_predictive(trace, samples=None, model=None, vars=None, size
for slc, idx in enumerate(indices):
if nchain > 1:
chain_idx, point_idx = np.divmod(idx, len_trace)
param = trace._straces[chain_idx].point(point_idx)
param = trace._straces[chain_idx % nchain].point(point_idx)
Copy link
Member

Choose a reason for hiding this comment

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

Fancy ;-)

Copy link
Member Author

Choose a reason for hiding this comment

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

I'll add a PR to numpy for my new divmodmod

@ColCarroll
Copy link
Member Author

Just rebased this - let me know if there are any changes that should be made on these PRs!

@junpenglao junpenglao merged commit bdc9966 into pymc-devs:master Oct 7, 2018
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.

None yet

2 participants