Skip to content

Commit

Permalink
making small changes for code submission
Browse files Browse the repository at this point in the history
  • Loading branch information
EliasVansteenkiste committed Apr 7, 2017
1 parent 1fd9771 commit 362d754
Show file tree
Hide file tree
Showing 26 changed files with 1,320 additions and 207 deletions.
25 changes: 12 additions & 13 deletions configs_class_dsb/dsb_a_eliasq10_mal2_s5_p8a1_spl.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ def candidates_prep_function(all_candidates, n_selection=None):
batch_size = 1

train_valid_ids = utils.load_pkl(pathfinder.FINAL_SPLIT_PATH)
print train_valid_ids.keys()
train_pids, valid_pids = train_valid_ids['train'], train_valid_ids['test']
#In the final stage we will have to add the pids of the new data
#test_ids = utils.load_pkl(pathfinder.FINAL_SPLIT_PATH)
train_pids, valid_pids, test_pids = train_valid_ids['train'], train_valid_ids['test'], [] #test_ids
print 'n train', len(train_pids)
print 'n valid', len(valid_pids)

Expand Down Expand Up @@ -114,19 +115,17 @@ def candidates_prep_function(all_candidates, n_selection=None):
patient_ids=valid_pids,
random=False, infinite=False)


tta_batch_size = 8


tta_test_data_iterator = data_iterators.DSBPatientsDataGeneratorTTA(data_path=pathfinder.DATA_PATH,
test_data_iterator = data_iterators.DSBPatientsDataGenerator(data_path=pathfinder.DATA_PATH,
batch_size=1,
transform_params=p_transform,
id2candidates_path=id2candidates_path,
id2label = id2label_all,
data_prep_fun=data_prep_function_tta,
candidates_prep_fun = candidates_prep_function,
n_candidates_per_patient=n_candidates_per_patient,
patient_ids=valid_pids,
tta = 64)
data_prep_fun=data_prep_function_valid,
candidates_prep_fun = candidates_prep_function,
id2candidates_path=id2candidates_path,
rng=rng,
patient_ids=test_pids,
random=False, infinite=False)


nchunks_per_epoch = train_data_iterator.nsamples / batch_size
max_nchunks = nchunks_per_epoch * 10
Expand Down
5 changes: 2 additions & 3 deletions configs_class_dsb/dsb_a_eliasq11_mal2_s5_p8a1_all.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,13 +68,13 @@ def candidates_prep_function(all_candidates, n_selection=None):

# data iterators
batch_size = 1

train_valid_ids = utils.load_pkl(pathfinder.VALIDATION_SPLIT_PATH)
train_pids, valid_pids, test_pids = train_valid_ids['training'], train_valid_ids['validation'], train_valid_ids['test']
print 'n train', len(train_pids)
print 'n valid', len(valid_pids)
print 'n test', len(test_pids)
all_pids = train_pids + valid_pids + test_pids
stage2_pids = [] #utils.load_pkl(pathfinder.STAGE2_PIDS)

id2label = utils_lung.read_labels(pathfinder.LABELS_PATH)
id2label_test = utils_lung.read_test_labels(pathfinder.TEST_LABELS_PATH)
Expand Down Expand Up @@ -118,7 +118,7 @@ def candidates_prep_function(all_candidates, n_selection=None):
id2candidates_path=id2candidates_path,
id2label = id2label_all,
rng=rng,
patient_ids=test_pids,
patient_ids=stage2_pids,
random=False, infinite=False)


Expand Down Expand Up @@ -146,7 +146,6 @@ def candidates_prep_function(all_candidates, n_selection=None):
patient_ids=valid_pids,
tta = 64)


nchunks_per_epoch = train_data_iterator.nsamples / batch_size
max_nchunks = nchunks_per_epoch * 10

Expand Down
26 changes: 11 additions & 15 deletions configs_class_dsb/dsb_a_eliasq11_mal2_s5_p8a1_spl.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,10 +69,10 @@ def candidates_prep_function(all_candidates, n_selection=None):
# data iterators
batch_size = 1


train_valid_ids = utils.load_pkl(pathfinder.FINAL_SPLIT_PATH)
print train_valid_ids.keys()
train_pids, valid_pids = train_valid_ids['train'], train_valid_ids['test']
#In the final stage we will have to add the pids of the new data
#test_ids = utils.load_pkl(pathfinder.FINAL_SPLIT_PATH)
train_pids, valid_pids, test_pids = train_valid_ids['train'], train_valid_ids['test'], [] #test_ids
print 'n train', len(train_pids)
print 'n valid', len(valid_pids)

Expand Down Expand Up @@ -106,20 +106,16 @@ def candidates_prep_function(all_candidates, n_selection=None):
patient_ids=valid_pids,
random=False, infinite=False)


tta_batch_size = 8


tta_test_data_iterator = data_iterators.DSBPatientsDataGeneratorTTA(data_path=pathfinder.DATA_PATH,
test_data_iterator = data_iterators.DSBPatientsDataGenerator(data_path=pathfinder.DATA_PATH,
batch_size=1,
transform_params=p_transform,
id2candidates_path=id2candidates_path,
id2label = id2label_all,
data_prep_fun=data_prep_function_tta,
candidates_prep_fun = candidates_prep_function,
n_candidates_per_patient=n_candidates_per_patient,
patient_ids=valid_pids,
tta = 64)

data_prep_fun=data_prep_function_valid,
candidates_prep_fun = candidates_prep_function,
id2candidates_path=id2candidates_path,
rng=rng,
patient_ids=test_pids,
random=False, infinite=False)

nchunks_per_epoch = train_data_iterator.nsamples / batch_size
max_nchunks = nchunks_per_epoch * 10
Expand Down
25 changes: 11 additions & 14 deletions configs_class_dsb/dsb_a_eliasq14_mal2_s5_p8a1_spl.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,8 +79,9 @@ def candidates_prep_function(all_candidates, n_selection=None):
batch_size = 1

train_valid_ids = utils.load_pkl(pathfinder.FINAL_SPLIT_PATH)
print train_valid_ids.keys()
train_pids, valid_pids = train_valid_ids['train'], train_valid_ids['test']
#In the final stage we will have to add the pids of the new data
#test_ids = utils.load_pkl(pathfinder.FINAL_SPLIT_PATH)
train_pids, valid_pids, test_pids = train_valid_ids['train'], train_valid_ids['test'], [] #test_ids
print 'n train', len(train_pids)
print 'n valid', len(valid_pids)

Expand Down Expand Up @@ -114,20 +115,16 @@ def candidates_prep_function(all_candidates, n_selection=None):
patient_ids=valid_pids,
random=False, infinite=False)


tta_batch_size = 8


tta_test_data_iterator = data_iterators.DSBPatientsDataGeneratorTTA(data_path=pathfinder.DATA_PATH,
test_data_iterator = data_iterators.DSBPatientsDataGenerator(data_path=pathfinder.DATA_PATH,
batch_size=1,
transform_params=p_transform,
id2candidates_path=id2candidates_path,
id2label = id2label_all,
data_prep_fun=data_prep_function_tta,
candidates_prep_fun = candidates_prep_function,
n_candidates_per_patient=n_candidates_per_patient,
patient_ids=valid_pids,
tta = 64)

data_prep_fun=data_prep_function_valid,
candidates_prep_fun = candidates_prep_function,
id2candidates_path=id2candidates_path,
rng=rng,
patient_ids=test_pids,
random=False, infinite=False)


nchunks_per_epoch = train_data_iterator.nsamples / batch_size
Expand Down
Loading

0 comments on commit 362d754

Please sign in to comment.