-
Notifications
You must be signed in to change notification settings - Fork 0
/
settingsSection.py
45 lines (41 loc) · 1.24 KB
/
settingsSection.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
#base_architecture = 'resnet152'
img_size = 224
#num_classes = 6
#PPs_per_class = 10
#prototype_shape = (num_classes*PPs_per_class, 128, 1, 1)
prototype_activation_function = 'log'
add_on_layers_type = 'regular'
#experiment_run = '001'
#---------------------------
# load the data
data_path = './datasets/Sec/' #'./datasets/tiny-imagenet-200/' #'./datasets/cub200_cropped/'
train_dir = data_path + 'train/' #'train_augmented/'
test_dir = data_path + 'test/'
train_push_dir = data_path + 'train/'
train_batch_size = 80
test_batch_size = 100
train_push_batch_size = 75
#---------------------------
# define optimizer
joint_optimizer_lrs = {'features': 1e-4,
'add_on_layers': 3e-3,
'prototype_vectors': 3e-3}
joint_lr_step_size = 5
warm_optimizer_lrs = {'add_on_layers': 3e-3,
'prototype_vectors': 3e-3}
last_layer_optimizer_lr = 1e-4
#---------------------------
# weighting of different training losses
coefs = {
'crs_ent': 1,
'clst': 0.8,
'sep': -0.08,
'l1': 1e-4,
}
#---------------------------
num_train_epochs = 31
num_warm_epochs = 5
push_start = 10
push_epochs = [i for i in range(num_train_epochs) if i % 10 == 0]
#---------------------------
#---------------------------