c8b28432a637a780eed96547260722ff3dede57e,niftynet/engine/sampler_selective.py,,rand_choice_coordinates,#Any#Any#Any#Any#Any#Any#,350

Before Change


        proba = []
        for (c,  p) in zip(candidates.flatten(), mean_counts_size.flatten()):
            if c >= 1:
                proba.append(p)
        print(len(list_indices), len(proba))
        list_indices_fin = np.random.choice(list_indices, n_samples,
                                            replace=False, p=proba)
    else:

After Change


    list_indices_fin = np.arange(len(candidates_indices))
    if mean_counts_size is not None:
        // Probability weighting considered
        proba = [p for (c, p)
                 in zip(candidates.flatten(), mean_counts_size.flatten())
                 if c >= 1]
        list_indices_fin = np.random.choice(
            list_indices_fin, n_samples, replace=False, p=proba)
    else:
        np.random.shuffle(list_indices_fin)
        list_indices_fin = list_indices_fin[:n_samples]

    max_coords = np.zeros((n_samples, N_SPATIAL), dtype=np.int32)
    half_win = np.floor(np.asarray(win_sizes["image"]) / 2).astype(np.int)
    for (i_sample, ind) in enumerate(list_indices_fin):
        indices_to_add = candidates_indices[ind]
        max_coords[i_sample, :N_SPATIAL] = \
            indices_to_add[:N_SPATIAL] - half_win[:N_SPATIAL]

    // adjust max spatial coordinates based on each spatial window size
    all_coordinates = {}
    for mod in list(win_sizes):
        win_size = win_sizes[mod][:N_SPATIAL]
        half_win_diff = np.floor((max_spatial_win - win_size) / 2.0)
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 4

Non-data size: 5

Instances


Project Name: NifTK/NiftyNet
Commit Name: c8b28432a637a780eed96547260722ff3dede57e
Time: 2017-10-04
Author: wenqi.li@ucl.ac.uk
File Name: niftynet/engine/sampler_selective.py
Class Name:
Method Name: rand_choice_coordinates


Project Name: NervanaSystems/coach
Commit Name: 85afb86893ad241660b3ff7dc23fe5eb581a83ce
Time: 2018-02-21
Author: zach.dwiel@intel.com
File Name: architectures/tensorflow_components/general_network.py
Class Name: GeneralTensorFlowNetwork
Method Name: get_model


Project Name: keras-team/autokeras
Commit Name: 1cda66554188c4504aa94d1bcffd4cef9ee8a997
Time: 2017-12-28
Author: jhfjhfj1@gmail.com
File Name: autokeras/net_transformer.py
Class Name:
Method Name: transform


Project Name: google/deepvariant
Commit Name: 13a85e08e713f374933bc4fc082f67e1fa8dcd02
Time: 2018-02-20
Author: cym@google.com
File Name: deepvariant/util/io_utils.py
Class Name:
Method Name: read_shard_sorted_tfrecords