749438fd8b7ffc29e78d042473cb00fda595d937,dataloader.py,,load_dataset,#Any#Any#Any#Any#Any#Any#Any#Any#Any#,13

Before Change


            data_num = len(trainset) // data_split
            ind_start = data_num*split_idx
            ind_end = min(data_num*(split_idx + 1), len(trainset))
            train_indices = indices[ind_start:ind_end]
            train_sampler = torch.utils.data.sampler.SubsetRandomSampler(train_indices)
            train_loader = torch.utils.data.DataLoader(trainset, batch_size=batch_size,
                                                       sampler=train_sampler,
                                                       shuffle=False, num_workers=threads)

After Change



            // Randomly sample indices. Use seed=0 in the generator to make this reproducible
            state = np.random.get_state()
            np.random.seed(0)
            indices = np.random.choice(indices, data_num, replace=False)
            np.random.set_state(state)

            train_sampler = torch.utils.data.sampler.SubsetRandomSampler(indices)
            train_loader = torch.utils.data.DataLoader(trainset, batch_size=batch_size,
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 5

Non-data size: 4

Instances


Project Name: tomgoldstein/loss-landscape
Commit Name: 749438fd8b7ffc29e78d042473cb00fda595d937
Time: 2018-12-27
Author: tomg@cs.umd.edu
File Name: dataloader.py
Class Name:
Method Name: load_dataset


Project Name: nipy/dipy
Commit Name: 18c5979b1b78598ae4b21decbda132ee15471c1b
Time: 2015-07-23
Author: jomaroceguedag@gmail.com
File Name: dipy/align/tests/test_imaffine.py
Class Name:
Method Name: test_mi_gradient


Project Name: tomgoldstein/loss-landscape
Commit Name: 749438fd8b7ffc29e78d042473cb00fda595d937
Time: 2018-12-27
Author: tomg@cs.umd.edu
File Name: dataloader.py
Class Name:
Method Name: load_dataset


Project Name: keras-team/keras
Commit Name: f3f9e020119736920b5bf3adc91fd658e1910775
Time: 2018-01-12
Author: ozabluda@gmail.com
File Name: examples/mnist_denoising_autoencoder.py
Class Name:
Method Name:


Project Name: matplotlib/matplotlib
Commit Name: c1b6a1c39fdd4661930280c6098de55359c5a078
Time: 2017-11-24
Author: anntzer.lee@gmail.com
File Name: examples/animation/animation_demo.py
Class Name:
Method Name:


Project Name: luispedro/mahotas
Commit Name: 93663c2cc8c0c8bc3c6f28c27679707305948c80
Time: 2010-05-11
Author: lpc@cmu.edu
File Name: tests/test_texture.py
Class Name:
Method Name: test_cooccurence