Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
code/*.pyc
code/__pycache__
*.py[cod]
*$py.class

# Editors
.vscode/
.idea/

# Windows
Thumbs.db

18 changes: 9 additions & 9 deletions code/exp_configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,8 @@
'LR',
'Epoch']

conf_baseline = {'dataset': ['cfw32x32',],
'classifier': ['allcnn', ],
conf_baseline = {'dataset': ['cfw32x32'],
'classifier': ['allcnn'],
'regularizer': [(1e-4, None)],
'LR': [LR],
'Epoch': [EPOCH]}
Expand Down Expand Up @@ -81,8 +81,8 @@
'classifier': ['allcnn', 'resnet'],
'target_shape': [(20, 19, 2), (28, 27, 1), (14, 11, 2), (18, 17, 1), (9, 6, 1), (6, 9, 1)],
'sensing_mode': ['tensor'],
'linear_sensing': [True,],
'end_to_end': [True,],
'linear_sensing': [True],
'end_to_end': [True],
'mean_update': [False],
'augmentation': [True],
'regularizer': [(1e-4, None)],
Expand All @@ -98,8 +98,8 @@
'classifier': ['allcnn'],
'target_shape': [(20, 19, 2), (28, 27, 1), (14, 11, 2), (18, 17, 1), (9, 6, 1), (6, 9, 1)],
'sensing_mode': ['tensor'],
'linear_sensing': [True,],
'end_to_end': [True,],
'linear_sensing': [True],
'end_to_end': [True],
'mean_update': [False],
'augmentation': [True],
'regularizer': [(1e-4, None)],
Expand All @@ -117,7 +117,7 @@
'target_shape': [(20, 19, 2), (28, 27, 1), (14, 11, 2), (18, 17, 1), (9, 6, 1), (6, 9, 1)],
'sensing_mode': ['tensor'],
'linear_sensing': [True, False],
'end_to_end': [True,],
'end_to_end': [True],
'mean_update': [False],
'augmentation': [True],
'regularizer': [(1e-4, None)],
Expand All @@ -133,8 +133,8 @@
'classifier': ['allcnn'],
'target_shape': [(28, 27, 1), (18, 17, 1), (9, 6, 1)],
'sensing_mode': ['tensor'],
'linear_sensing': [True,],
'end_to_end': [True,],
'linear_sensing': [True],
'end_to_end': [True],
'mean_update': [False],
'augmentation': [True],
'regularizer': [(1e-4, None)],
Expand Down
23 changes: 12 additions & 11 deletions code/train.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,16 @@ def save_result(output, path):
fid.close()

def main(argv):

try:
opts, args = getopt.getopt(argv,"h", ['index=' ])
opts, args = getopt.getopt(argv, "h", ['index='])

except getopt.GetoptError:
sys.exit(2)
for opt, arg in opts:

for opt, arg in opts:
if opt == '--index':
index = int(arg)

baseline_configurations = Utility.create_configuration([Conf.baseline_var_names], [Conf.conf_baseline])
experiment_configurations = Utility.create_configuration([Conf.hyperparameters]*5,
[Conf.conf_vector,
Expand All @@ -47,13 +46,15 @@ def main(argv):
output = Runners.train_baseline(baseline_configurations[index])
filename = '_'.join([str(v) for v in baseline_configurations[index]]) + '.pickle'
filename = os.path.join(Conf.BASELINE_DIR, filename)

else:
output = Runners.train_sensing(experiment_configurations[index-len(baseline_configurations)])
filename = '_'.join([str(v) for v in experiment_configurations[index-len(baseline_configurations)]]) + '.pickle'
output = Runners.train_sensing(experiment_configurations[index - len(baseline_configurations)])
filename = '_'.join(
[str(v) for v in experiment_configurations[index - len(baseline_configurations)]]) + '.pickle'
filename = os.path.join(Conf.OUTPUT_DIR, filename)

save_result(output, filename)



if __name__ == "__main__":
main(sys.argv[1:])