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

Before Change


        list_indices_fin = np.random.choice(list_indices, n_samples,
                                            replace=False, p=proba)
    else:
        print("No probability weighting needed")
        list_indices_fin = list_indices
        np.random.shuffle(list_indices)
    for i in range(0, n_samples):
        indices_to_add = candidates_indices[list_indices_fin[i]]

After Change


        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: 3

Non-data size: 4

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: explosion/thinc
Commit Name: 1eed8db0146806c529a69df2c690c9fb2174283c
Time: 2017-02-01
Author: honnibal+gh@gmail.com
File Name: examples/quora_similarity.py
Class Name:
Method Name: main


Project Name: pfnet/optuna
Commit Name: 8a3c5668c2cbac8d6fefbd44a70641dd2bf23334
Time: 2020-07-20
Author: imamura@ms.k.u-tokyo.ac.jp
File Name: tests/multi_objective/hypervolume_tests/test_wfg.py
Class Name:
Method Name: test_wfg_nd