Skip to content

Commit 99decc3

Browse files
committed
[enhancement] Simplify config parameters (#40)
* [refactor] Simplify keys for scheduler, optimizer and training * [refactor] Simplify keys with _attributes -> _configs
1 parent 33415f4 commit 99decc3

File tree

122 files changed

+510
-523
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+510
-523
lines changed

configs/captioning/coco/butd.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
includes:
22
- common/defaults/configs/datasets/captioning/coco.yml
3-
model_attributes:
3+
model_config:
44
butd: &butd
55
model_data_dir: ../data/
66
metrics:
@@ -35,13 +35,13 @@ model_attributes:
3535
weights_file: detectron/fc6/fc7_w.pkl
3636
inference:
3737
type: greedy
38-
optimizer_attributes:
38+
optimizer:
3939
type: Adamax
4040
params:
4141
eps: 1.0e-08
4242
lr: 0.01
4343
weight_decay: 0
44-
training_parameters:
44+
training:
4545
clip_norm_mode: all
4646
clip_gradients: true
4747
lr_ratio: 0.1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
includes:
22
- ../configs/captioning/coco/butd.yml
3-
model_attributes:
3+
model_config:
44
butd: &butd
55
inference:
66
type: beam_search
77
params:
88
beam_length: 5
9-
training_parameters:
9+
training:
1010
batch_size: 1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
includes:
22
- ../configs/captioning/coco/butd.yml
3-
model_attributes:
3+
model_config:
44
butd: &butd
55
inference:
66
type: nucleus_sampling
77
params:
88
sum_threshold: 0.8
9-
training_parameters:
9+
training:
1010
batch_size: 1

configs/captioning/m4c_textcaps/butd.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
includes:
22
- common/defaults/configs/datasets/captioning/coco.yml
3-
dataset_attributes:
3+
dataset_config:
44
coco:
55
image_features:
66
train:
@@ -43,7 +43,7 @@ dataset_attributes:
4343
use_ocr: false
4444
# Return spatial information of OCR tokens if present
4545
use_ocr_info: false
46-
model_attributes:
46+
model_config:
4747
butd: &butd
4848
model_data_dir: ../data/
4949
metrics:
@@ -78,13 +78,13 @@ model_attributes:
7878
weights_file: detectron/fc6/fc7_w.pkl
7979
inference:
8080
type: greedy
81-
optimizer_attributes:
81+
optimizer:
8282
type: Adamax
8383
params:
8484
eps: 1.0e-08
8585
lr: 0.01
8686
weight_decay: 0
87-
training_parameters:
87+
training:
8888
clip_norm_mode: all
8989
clip_gradients: true
9090
lr_ratio: 0.1
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
includes:
22
- ../configs/captioning/m4c_textcaps/butd.yml
3-
dataset_attributes:
3+
dataset_config:
44
coco:
55
imdb_files:
66
val:
77
- imdb/m4c_textcaps/imdb_val_filtered_by_image_id.npy
8-
model_attributes:
8+
model_config:
99
butd: &butd
1010
inference:
1111
type: beam_search
1212
params:
1313
beam_length: 5
14-
training_parameters:
14+
training:
1515
batch_size: 1

configs/captioning/m4c_textcaps/butd_eval_pretrained_coco_model.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
includes:
22
- ../configs/captioning/m4c_textcaps/butd_beam_search.yml
3-
dataset_attributes:
3+
dataset_config:
44
coco:
55
processors:
66
text_processor:

configs/captioning/m4c_textcaps/m4c_captioner.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
includes:
22
- common/defaults/configs/datasets/captioning/m4c_textcaps.yml
33
# Use soft copy
4-
dataset_attributes:
4+
dataset_config:
55
m4c_textcaps:
66
image_features:
77
train:
@@ -43,7 +43,7 @@ dataset_attributes:
4343
type: phoc
4444
params:
4545
max_length: 50
46-
model_attributes:
46+
model_config:
4747
m4c_captioner:
4848
lr_scale_frcn: 0.1
4949
lr_scale_text_bert: 0.1
@@ -73,13 +73,13 @@ model_attributes:
7373
losses:
7474
- type: m4c_decoding_bce_with_mask
7575
remove_unk_in_pred: true
76-
optimizer_attributes:
76+
optimizer:
7777
params:
7878
eps: 1.0e-08
7979
lr: 1e-4
8080
weight_decay: 0
8181
type: Adam
82-
training_parameters:
82+
training:
8383
clip_norm_mode: all
8484
clip_gradients: true
8585
max_grad_l2_norm: 0.25

configs/captioning/m4c_textcaps/m4c_captioner_coco.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
includes:
22
- common/defaults/configs/datasets/captioning/m4c_textcaps.yml
33
# Use soft copy
4-
dataset_attributes:
4+
dataset_config:
55
m4c_textcaps:
66
image_features:
77
train:
@@ -43,7 +43,7 @@ dataset_attributes:
4343
type: phoc
4444
params:
4545
max_length: 50
46-
model_attributes:
46+
model_config:
4747
m4c_captioner:
4848
lr_scale_frcn: 0.1
4949
lr_scale_text_bert: 0.1
@@ -73,13 +73,13 @@ model_attributes:
7373
losses:
7474
- type: m4c_decoding_bce_with_mask
7575
remove_unk_in_pred: true
76-
optimizer_attributes:
76+
optimizer:
7777
params:
7878
eps: 1.0e-08
7979
lr: 1e-4
8080
weight_decay: 0
8181
type: Adam
82-
training_parameters:
82+
training:
8383
clip_norm_mode: all
8484
clip_gradients: true
8585
max_grad_l2_norm: 0.25

configs/captioning/m4c_textcaps/m4c_captioner_coco_eval_on_textcaps.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
includes:
22
- ../configs/captioning/m4c_textcaps/m4c_captioner_coco.yml
3-
dataset_attributes:
3+
dataset_config:
44
m4c_textcaps:
55
image_features:
66
val:

configs/captioning/m4c_textcaps/m4c_captioner_coco_textcaps_joint.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
includes:
22
- common/defaults/configs/datasets/captioning/m4c_textcaps.yml
33
# Use soft copy
4-
dataset_attributes:
4+
dataset_config:
55
m4c_textcaps:
66
image_features:
77
train:
@@ -111,7 +111,7 @@ dataset_attributes:
111111
type: phoc
112112
params:
113113
max_length: 50
114-
model_attributes:
114+
model_config:
115115
m4c_captioner:
116116
lr_scale_frcn: 0.1
117117
lr_scale_text_bert: 0.1
@@ -141,13 +141,13 @@ model_attributes:
141141
losses:
142142
- type: m4c_decoding_bce_with_mask
143143
remove_unk_in_pred: true
144-
optimizer_attributes:
144+
optimizer:
145145
params:
146146
eps: 1.0e-08
147147
lr: 1e-4
148148
weight_decay: 0
149149
type: Adam
150-
training_parameters:
150+
training:
151151
clip_norm_mode: all
152152
clip_gradients: true
153153
max_grad_l2_norm: 0.25

configs/captioning/m4c_textcaps/m4c_captioner_without_ocr.yml

+4-4
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
includes:
22
- common/defaults/configs/datasets/captioning/m4c_textcaps.yml
33
# Use soft copy
4-
dataset_attributes:
4+
dataset_config:
55
m4c_textcaps:
66
image_features:
77
train:
@@ -44,7 +44,7 @@ dataset_attributes:
4444
params:
4545
max_length: 50
4646
use_ocr: False # remove all the OCRs from each image
47-
model_attributes:
47+
model_config:
4848
m4c_captioner:
4949
lr_scale_frcn: 0.1
5050
lr_scale_text_bert: 0.1
@@ -74,13 +74,13 @@ model_attributes:
7474
losses:
7575
- type: m4c_decoding_bce_with_mask
7676
remove_unk_in_pred: true
77-
optimizer_attributes:
77+
optimizer:
7878
params:
7979
eps: 1.0e-08
8080
lr: 1e-4
8181
weight_decay: 0
8282
type: Adam
83-
training_parameters:
83+
training:
8484
clip_norm_mode: all
8585
clip_gradients: true
8686
max_grad_l2_norm: 0.25

configs/pythia_bert/cc_pretrain.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ includes:
22
- ../configs/pythia_bert/coco_pretrain.yml
33
- common/defaults/configs/datasets/captioning/masked_cc.yml
44

5-
model_attributes:
5+
model_config:
66
pythia_bert:
77
combine_embeddings: true
88
model_data_dir: ../data/
@@ -56,6 +56,6 @@ model_attributes:
5656
num_heads: 8
5757
dropout: 0.1
5858

59-
dataset_attributes:
59+
dataset_config:
6060
masked_cc:
6161
return_info: true

configs/pythia_bert/coco_pretrain.yml

+7-7
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
includes:
22
- common/defaults/configs/datasets/captioning/masked_coco.yml
33

4-
model_attributes:
4+
model_config:
55
pythia_bert:
66
combine_embeddings: true
77
model_data_dir: ../data/
@@ -55,24 +55,24 @@ model_attributes:
5555
num_heads: 8
5656
dropout: 0.1
5757

58-
dataset_attributes:
58+
dataset_config:
5959
masked_coco:
6060
return_info: true
6161

62-
optimizer_attributes:
62+
optimizer:
6363
type: adam_w
6464
params:
6565
lr: 5e-5
6666
eps: 1e-8
6767

68-
scheduler_attributes:
68+
scheduler:
6969
type: warmup_linear
7070
params:
7171
num_warmup_steps: 1000
7272
num_training_steps: 11000
73-
74-
training_parameters:
73+
74+
training:
7575
batch_size: 480
7676
lr_scheduler: true
7777
# Don't forget to update schedule_attributes if you update this
78-
max_updates: 11000
78+
max_updates: 11000

configs/pythia_bert/combined_coco_vqa2.yml

+5-5
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,17 @@ includes:
22
- ../configs/visual_bert/coco_pretrain.yml
33
- ../configs/visual_bert/vqa2.yml
44

5-
model_attributes:
5+
model_config:
66
visual_bert:
77
training_head_type: pretraining,vqa
88

9-
scheduler_attributes:
9+
scheduler:
1010
type: warmup_linear
1111
params:
1212
num_warmup_steps: 3000
1313
num_training_steps: 33000
14-
15-
training_parameters:
14+
15+
training:
1616
max_updates: 34000
1717
monitored_metric: vqa2/vqa_accuracy
18-
metric_minimize: false
18+
metric_minimize: false

configs/pythia_bert/masked_vqa2_pretrain.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ includes:
22
- common/defaults/configs/datasets/vqa/masked_vqa2.yml
33
- ../configs/pythia_bert/coco_pretrain.yml
44

5-
dataset_attributes:
5+
dataset_config:
66
masked_vqa2:
77
imdb_files:
88
train:

configs/pythia_bert/visual_entailment.yml

+5-6
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,15 @@ includes:
22
- common/defaults/configs/datasets/reasoning/visual_entailment.yml
33
- ../configs/pythia_bert/vqa2.yml
44

5-
model_attributes:
5+
model_config:
66
pythia_bert:
77
training_head_type: visual_entailment
88
losses:
99
- type: cross_entropy
1010
metrics:
1111
- accuracy
1212

13-
dataset_attributes:
13+
dataset_config:
1414
visual_entailment:
1515
return_info: true
1616
processors:
@@ -23,14 +23,13 @@ dataset_attributes:
2323
do_lower_case: true
2424
mask_probability: 0
2525
max_seq_length: 128
26-
27-
scheduler_attributes:
26+
27+
scheduler:
2828
type: warmup_linear
2929
params:
3030
num_warmup_steps: 6000
3131
num_training_steps: 60000
3232

33-
training_parameters:
33+
training:
3434
monitored_metric: visual_entailment/accuracy
3535
metric_minimize: false
36-

0 commit comments

Comments
 (0)