Skip to content

Commit f21f475

Browse files
[feat] Add UNITER yaml config
Add configs for UNITER vqa2 finetuning. ghstack-source-id: f82a8fb Pull Request resolved: #1128
1 parent 6758d45 commit f21f475

File tree

3 files changed

+145
-0
lines changed

3 files changed

+145
-0
lines changed

projects/uniter/README.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# UNITER
2+
3+
This repository contains the code for pytorch implementation of UNITER model, released originally under this ([repo](https://github.com/ChenRocks/UNITER/)). Please cite the following papers if you are using UNITER model from mmf:
4+
5+
* Chen, Y.-C., Li, L., Yu, L., Kholy, A. E., Ahmed, F., Gan,
6+
Z., Cheng, Y., and jing Liu, J. *Uniter: Universal imagetext representation learning.* In European Conference on
7+
Computer Vision, 2020b. ([arXiV](https://arxiv.org/pdf/1909.11740))
8+
```
9+
@inproceedings{chen2020uniter,
10+
title={Uniter: Universal image-text representation learning},
11+
author={Chen, Yen-Chun and Li, Linjie and Yu, Licheng and Kholy, Ahmed El and Ahmed, Faisal and Gan, Zhe and Cheng, Yu and Liu, Jingjing},
12+
booktitle={ECCV},
13+
year={2020}
14+
}
15+
```
16+
17+
18+
Please see [https://mmf.sh/docs/projects/uniter](https://mmf.sh/docs/projects/uniter) for more details on how to use the UNITER model.
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
model_config:
2+
uniter:
3+
do_pretraining: true
4+
mask_probability: 0.15
5+
tasks:
6+
- mlm
7+
- itm
8+
- mrc
9+
- mrfr
10+
- wra
11+
heads:
12+
mlm:
13+
type: mlm
14+
itm:
15+
type: itm
16+
mrc:
17+
type: mrc
18+
mrfr:
19+
type: mrfr
20+
wra:
21+
type: wra
22+
23+
dataset_config:
24+
masked_coco:
25+
false_caption: true
26+
false_caption_probability: 0.1
27+
zoo_requirements:
28+
- coco.defaults
29+
return_features_info: true
30+
use_features: true
31+
use_images: false
32+
processors:
33+
masked_token_processor:
34+
type: uniter_text_tokenizer
35+
params:
36+
tokenizer_config:
37+
type: bert-base-uncased
38+
params:
39+
do_lower_case: true
40+
mask_probability: 0.15
41+
max_seq_length: 25
42+
images:
43+
train:
44+
- coco/defaults/images/train2014
45+
- coco/defaults/images/val2014
46+
- coco/defaults/images/train2014
47+
- coco/defaults/images/val2014
48+
- coco/defaults/images/val2014
49+
val:
50+
- coco/defaults/images/val2014
51+
test:
52+
- coco/defaults/images/test2015
53+
54+
optimizer:
55+
type: adam_w
56+
params:
57+
lr: 5e-5
58+
eps: 1e-8
59+
60+
scheduler:
61+
type: warmup_linear
62+
params:
63+
num_warmup_steps: 6000
64+
num_training_steps: 60000
65+
66+
training:
67+
batch_size: 480
68+
lr_scheduler: true
69+
# Don't forget to update schedule_attributes if you update this
70+
max_updates: 60000
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# includes:
2+
# - ../projects/unit/configs/vqa2_dataset_cfg.yaml
3+
4+
model_config:
5+
uniter:
6+
do_pretraining: false
7+
tasks: vqa2
8+
heads:
9+
vqa2:
10+
type: mlp
11+
num_labels: 3129
12+
lr_multiplier: 10
13+
losses:
14+
vqa2: logit_bce
15+
16+
17+
dataset_config:
18+
vqa2:
19+
return_features_info: true
20+
use_features: true
21+
use_images: false
22+
processors:
23+
text_processor:
24+
type: uniter_text_tokenizer
25+
params:
26+
tokenizer_config:
27+
type: bert-base-uncased
28+
params:
29+
do_lower_case: true
30+
mask_probability: 0
31+
max_seq_length: 60
32+
33+
optimizer:
34+
type: adam_w
35+
params:
36+
lr: 8e-5
37+
eps: 1e-8
38+
weight_decay: 0.01
39+
40+
scheduler:
41+
type: warmup_linear
42+
params:
43+
num_warmup_steps: 600
44+
num_training_steps: 5000
45+
46+
evaluation:
47+
metrics:
48+
- vqa_accuracy
49+
50+
training:
51+
batch_size: 5120
52+
lr_scheduler: true
53+
# Don't forget to update schedule_attributes if you update this
54+
max_updates: 5000
55+
early_stop:
56+
criteria: vqa2/vqa_accuracy
57+
minimize: false

0 commit comments

Comments
 (0)