generate_config.py
Go to the documentation of this file.
1 """
2 This is the configuration module.
3 """
4 
5 __version__ = '1.0'
6 __author__ = 'Saul Alonso-Monsalve'
7 __email__ = "saul.alonso.monsalve@cern.ch"
8 
9 import configparser
10 
11 config = configparser.ConfigParser()
12 
13 config['random'] = {'seed':'7',
14  'shuffle':'True'}
15 
16 config['images'] = {'views':'3',
17  'planes':'500',
18  'cells':'500',
19  'standardize':'False',
20  'path':'/scratch/cvn/datasetRaw'}
21 
22 config['dataset'] = {'uniform':'False',
23  'path':'/scratch/cvn/dataset',
24  'partition_prefix':'/partition',
25  'labels_prefix':'/labels'}
26 
27 config['log'] = {'path':'/scratch/cvn/log',
28  'prefix':'/train'}
29 
30 config['model'] = {'architecture':'resnet50',
31  'checkpoint_path':'/scratch/cvn/checkpoint',
32  'checkpoint_prefix':'/model',
33  'checkpoint_save_many':'True',
34  'checkpoint_save_best_only':'False',
35  'checkpoint_period':'1',
36  'parallelize':'False',
37  'gpus':'8',
38  'print_summary':'False',
39  'branches':'False',
40  'outputs':'5'}
41 
42 config['train'] = {'resume':'False',
43  'weighted_loss_function':'False',
44  'class_weights_prefix':'/class_weights',
45  'lr':'0.1',
46  'momentum':'0.9',
47  'decay':'0.0001',
48  'batch_size':'32',
49  'epochs':'100',
50  'early_stopping_patience':'5',
51  'fraction':'0.98',
52  'max_queue_size':'10'}
53 
54 config['validation'] = {'batch_size':'32',
55  'fraction':'0.01'}
56 
57 config['test'] = {'output_path':'/scratch/cvn/output',
58  'output_prefix':'/test_info',
59  'cut_nue':'0.7',
60  'cut_numu':'0.5',
61  'cut_nutau':'0.7',
62  'cut_nc':'0.7',
63  'batch_size':'32',
64  'fraction':'0.01'}
65 
66 with open('config.ini', 'w') as configfile:
67  config.write(configfile)
int open(const char *, int)
Opens a file descriptor.