-
Notifications
You must be signed in to change notification settings - Fork 0
/
sweep_add_agent.py
54 lines (49 loc) · 1.37 KB
/
sweep_add_agent.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
from sweep_SegFormer import sweep_train
import wandb
LIGHT = True
WANDB = True
if not LIGHT:
PATH_JPGS = "RailNet_DT/rs19_val/jpgs/rs19_val"
PATH_MASKS = "RailNet_DT/rs19_val/uint8/rs19_val" # /rails
else:
PATH_JPGS = "RailNet_DT/rs19_val_light/jpgs/rs19_val"
PATH_MASKS = "RailNet_DT/rs19_val_light/uint8/rs19_val"
PATH_MODELS = "RailNet_DT/models"
PATH_LOGS = "RailNet_DT/logs"
sweep_config = {
'method': 'random', # 'bayes', 'grid'
'metric': {
'name': 'MIoU',
'goal': 'maximize'
},
'parameters': {
'epochs': {
'value': 10
},
'learning_rate': {
'distribution': 'uniform',
'min': 0.0001,
'max': 0.01
},
'optimizer': {
'values': ['adam', 'sgd', 'adagrad'] # Different optimizers to sweep over
},
'scheduler': {
'values': ['ReduceLROnPlateau', 'LinearLR'] # Different schedulers to sweep over
},
'batch_size': {
'distribution': 'q_log_uniform_values',
'q': 8,
'min': 8,
'max': 32
},
'image_size': {
'value': 550 # Fixed image size
},
'outs': {
'value': 13 # Fixed number of outputs
}
}
}
if __name__ == "__main__":
wandb.agent('ovalach/RailNet/1bl4fkdx', sweep_train, count=20)