66d21e1fcd43323289840ce83e4193e6b9957d0c,pymc3/sampling.py,,sample_ppc_w,#Any#Any#Any#Any#Any#Any#,696
Before Change
// ensure n sum up to min_tr
idx = np.argmax(n)
n[idx] = n[idx] + min_tr - np.sum(n)
trace = np.concatenate([np.random.choice(traces[i], j)
for i, j in enumerate(n)])
obs = [x for m in models for x in m.observed_RVs]
variables = np.repeat(obs, n)
After Change
n[idx] = n[idx] + min_tr - np.sum(n)
trace = []
for i, j in enumerate(n):
tr = traces[i]
len_trace = len(tr)
nchain = tr.nchains
indices = np.random.randint(0, nchain*len_trace, j)
chain_idx, point_idx = np.divmod(indices, len_trace)
for idx in zip(chain_idx, point_idx):
trace.append(tr._straces[idx[0]].point(idx[1]))
obs = [x for m in models for x in m.observed_RVs]
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 7
Instances
Project Name: pymc-devs/pymc3
Commit Name: 66d21e1fcd43323289840ce83e4193e6b9957d0c
Time: 2017-11-21
Author: junpeng.lao@unifr.ch
File Name: pymc3/sampling.py
Class Name:
Method Name: sample_ppc_w
Project Name: ContextLab/hypertools
Commit Name: ab58ffb31a31fe93823c2792fa2c0cc779a0ec40
Time: 2016-12-19
Author: andrew.heusser@gmail.com
File Name: python/examples/hypertools_demo-PPCA.py
Class Name:
Method Name:
Project Name: ContextLab/hypertools
Commit Name: 65106299a6514d849453339381d4cec2aa741268
Time: 2016-12-19
Author: andrew.heusser@gmail.com
File Name: python/examples/hypertools_demo-PPCA.py
Class Name:
Method Name: