-
Notifications
You must be signed in to change notification settings - Fork 68
/
Copy pathpostprocessor_train.yaml
128 lines (105 loc) · 2.38 KB
/
postprocessor_train.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
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
postfix: "postprocessing"
seed: 42
precision: 16
accelerator: gpu
devices: 2
find_unused_parameters: False
dataset_root: /path/to/dataset/ # <---- specify path to your dataset
logs_root: /path/to/logs # <---- specify path to your logs
dataframe_name: df.csv
logs_folder: ${now:%Y-%m-%d_%H-%M-%S}_${postfix}
num_workers: 20
max_epochs: 1000
valid_period: 10
# CACHE EMBEDDINGS PRODUCED BY BASELINE FEATURE EXTRACTOR
embeddings_cache_dir: ${dataset_root}
extractor_weights: /path/to/extractor.ckpt # <---- specify path to baseline feature extractor
extractor:
name: vit
args:
normalise_features: True
use_multi_scale: False
weights: ${extractor_weights}
arch: vits16
transforms_extraction:
name: norm_resize_hypvit_torch
args:
im_size: 224
crop_size: 224
# TRAIN POSTPROCESSOR
pairwise_model:
name: concat_siamese
args:
mlp_hidden_dims: [192]
extractor:
name: vit
args:
normalise_features: False
use_multi_scale: False
weights: ${extractor_weights}
arch: vits16
hard_pairs_mining: True
optimizer:
name: adam
args:
lr: 2e-3
freeze_n_epochs: 3
scheduling:
scheduler_interval: epoch
scheduler_frequency: 1
scheduler:
name: multi_step
args:
gamma: 5e-3
milestones:
- ${freeze_n_epochs}
sampler:
name: balance
args:
n_labels: 30
n_instances: 4
transforms_train:
name: augs_hypvit_torch
args:
im_size: 224
min_scale: 0.8
# VALIDATE POSTPROCESSOR BY RE-RANKING TOP-N OUTPUTS
batch_size_inference: 128
postprocessor:
name: pairwise_images
args:
top_n: 5
pairwise_model: ${pairwise_model}
transforms:
name: norm_resize_hypvit_torch
args:
im_size: 224
crop_size: 224
num_workers: ${num_workers}
batch_size: ${batch_size_inference}
verbose: True
use_fp16: True
metric_for_checkpointing: OVERALL/cmc/1
log_images: False
metric_args:
metrics_to_exclude_from_visualization: [cmc,]
cmc_top_k: [1, 10, 20, 30, 100]
map_top_k: [5, 10]
fmr_vals: []
pcf_variance: []
return_only_overall_category: True
visualize_only_overall_category: True
logger:
name: wandb # requires <WANDB_API_KEY> as global env
args:
project: "test_project"
tags:
- postprocessing
hydra_dir: ${logs_root}/${logs_folder}/
hydra:
run:
dir: ${hydra_dir}
searchpath:
- pkg://oml.configs
job:
chdir: True