-
Notifications
You must be signed in to change notification settings - Fork 0
/
train_config-res.yaml
109 lines (96 loc) · 2.26 KB
/
train_config-res.yaml
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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
version: v1.0.0
random_seed: 133
port: 11111
dataset:
type: custom
image_reader:
type: npy
kwargs:
image_dir: ./chunks_scaled/
train:
meta_file: ./chunks_scaled/metadata/train_metadata.json
rebalance: False
hflip: True
vflip: True
rotate: True
test:
meta_file: ./chunks_scaled/metadata/test_metadata.json
input_size: [224,224] # [h,w]
batch_size: 32
normals: [0]
workers: 10 # number of workers of dataloader for each process
criterion:
- name: FeatureMSELoss
type: FeatureMSELoss
kwargs:
weight: 1.0
trainer:
max_epoch: 250
clip_max_norm: 0.1
val_freq_epoch: 10
print_freq_step: 200
tb_freq_step: 500
lr_scheduler:
type: StepLR
kwargs:
step_size: 100
gamma: 0.5
optimizer:
type: AdamW
kwargs:
lr: 0.0001
betas: [0.9, 0.999]
weight_decay: 0.0001
saver:
auto_resume: False
always_save: False
load_path: UniAD/stitch-o_checkpoint/ckpt.pth.tar
save_dir: UniAD/stitch-o_checkpoint/
log_dir: UniAD/log/
evaluator:
save_dir: result_eval_temp
key_metric: mean_std_auc
metrics:
auc:
- name: std
- name: max
kwargs:
avgpool_size: [16, 16]
- name: mean
frozen_layers: [backbone]
net:
- name: backbone
type: models.backbones.resnet50
frozen: True
kwargs:
pretrained: True
# select outlayers from: resnet [1,2,3,4], efficientnet [1,2,3,4,5]
# empirically, for industrial: resnet [1,2,3] or [2,3], efficientnet [1,2,3,4] or [2,3,4]
outlayers: [1,2,3]
- name: neck
prev: backbone
type: models.necks.MFCN
kwargs:
outstrides: [16]
- name: reconstruction
prev: neck
type: models.reconstructions.UniAD
kwargs:
pos_embed_type: learned
hidden_dim: 256
nhead: 8
num_encoder_layers: 4
num_decoder_layers: 4
dim_feedforward: 1024
dropout: 0.0
activation: relu
normalize_before: False
feature_jitter:
scale: 0.0
prob: 0.0
neighbor_mask:
neighbor_size: [7,7]
mask: [True, True, True] # whether use mask in [enc, dec1, dec2]
save_recon: False
initializer:
method: xavier_uniform