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]
    variables = np.repeat(obs, n)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

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: CyberReboot/NetworkML
Commit Name: a9e42a7f1d0ea64be0371a6f7aff5039b5a48f4f
Time: 2017-11-15
Author: CStephenson970@gmail.com
File Name: NodeClassifier/iterator.py
Class Name: BatchIterator
Method Name: gen_data


Project Name: mariogeiger/se3cnn
Commit Name: b4447d7d91c83eaa3dddd3a14af9d8a8022c7c20
Time: 2017-11-15
Author: geiger.mario@gmail.com
File Name: arch/lung1.py
Class Name: MyModel
Method Name: create_train_batches