2c5d24194dbe627dd78dbeabbe6811f3e274181a,generator.py,,data_generator,#,45

Before Change




def data_generator(data_file, index_list, batch_size=1, binary=True):
    nb_subjects = len(index_list)
    while True:
        shuffle(index_list)
        nb_batches = nb_subjects/batch_size
        // TODO: Edge case? Currently this is handled by flooring the number of training/testing samples

After Change


            y_list.append(data_file.root.truth[index])
            if len(x_list) == batch_size:
                x = np.asarray(x_list)
                y = np.asarray(y_list)
                x_list = list()
                y_list = list()
                if binary:
                    y[y > 0] = 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 3

Instances


Project Name: ellisdg/3DUnetCNN
Commit Name: 2c5d24194dbe627dd78dbeabbe6811f3e274181a
Time: 2017-04-07
Author: david.ellis@unmc.edu
File Name: generator.py
Class Name:
Method Name: data_generator


Project Name: explosion/thinc
Commit Name: 9b19c1ebf37ed88593f91dc084b63e1c7e9aa03d
Time: 2020-01-04
Author: honnibal+gh@gmail.com
File Name: thinc/layers/foreach.py
Class Name:
Method Name: forward


Project Name: Cadene/bootstrap.pytorch
Commit Name: 3a82adac40bbfe179e5ea23d7baf05a92ae6aba3
Time: 2019-04-29
Author: mcoaky@gmail.com
File Name: bootstrap/engines/engine.py
Class Name: Engine
Method Name: train_epoch