WwYc commited on
Commit
d8a5b08
·
verified ·
1 Parent(s): ec31558

Delete lxmert/run

Browse files
lxmert/run/README.md DELETED
@@ -1,49 +0,0 @@
1
- # Running Script Arguments
2
-
3
- ```
4
- Data Splits:
5
- --train [str,str,...]: use the splits (separated by comma) in training.
6
- --valid [str,str,...]: use the splits (separated by comma) in validation.
7
- --test [str,str,...]: use the splits (separated by comma) in testing.
8
- Model Architecture:
9
- --llayers [int]: number of layers in language encoder.
10
- --xlayers [int]: number of layers in cross-modality encoder.
11
- --rlayers [int]: number of layers in object relationship encoder.
12
- Load Weights:
13
- --load [str='path/to/saved_model']: load fine-tuned model path/to/saved_model.pth.
14
- --loadLXMERT [str='path/to/saved_model']: load pre-trained model without answer heads from path/to/saved_model_LXRT.pth.
15
- --loadLXMERTQA [str='path/to/saved_model']: load pre-trained model with answer head path/to/saved_model_LXRT.pth.
16
- --fromScratch: If none of the above loading parameters are set, the default mode would
17
- load the pre-trained BERT weights.
18
- As we promised to EMNLP reviewers, the language encoder would be re-initialized with this one-line argument to test the performance without BERT weights.
19
- Training Hyper Parameters:
20
- --batchSize [int]: batch size.
21
- --optim [str]: optimizers.
22
- --lr [float]: peak learning rate.
23
- --epochs [int]: training epochs.
24
- Debugging:
25
- --tiny: Load 512 images for each data split. (Note: number of images might be changed due to dataset specification)
26
- --fast: Load 5000 images for each data split. (Note: number of images might be changed due to dataset specification)
27
- ```
28
-
29
- # Pre-training-Specific Arguments
30
- ```
31
- Pre-training Tasks:
32
- --taskMaskLM: use the masked language model task.
33
- --taskObjPredict: use the masked object prediction task.
34
- --taskMatched: use the cross-modality matched task.
35
- --taskQA: use the image QA task.
36
- Visual Pre-training Losses (Tasks):
37
- --visualLosses [str,str,...]: The sub-tasks in pre-training visual modality. Each one is from 'obj,attr,feat'.
38
- obj: detected-object-label classification.
39
- attr: detected-object-attribute classification.
40
- feat: RoI-feature regression.
41
- Mask Rate in Pre-training:
42
- --wordMaskRate [float]: The prob of masking a word.
43
- --objMaskRate [float]: The prob of masking an object.
44
- Initialization:
45
- --fromScratch: The default mode would load the pre-trained BERT weights into the model.
46
- As we promised to EMNLP reviewers, this option would re-initialize the language encoder.
47
- ```
48
-
49
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lxmert/run/gqa_finetune.bash DELETED
@@ -1,17 +0,0 @@
1
- # The name of this experiment.
2
- name=$2
3
-
4
- # Save logs and models under snap/gqa; make backup.
5
- output=snap/gqa/$name
6
- mkdir -p $output/src
7
- cp -r src/* $output/src/
8
- cp $0 $output/run.bash
9
-
10
- # See Readme.md for option details.
11
- CUDA_VISIBLE_DEVICES=$1 PYTHONPATH=$PYTHONPATH:./src \
12
- python src/tasks/gqa.py \
13
- --train train,valid --valid testdev \
14
- --llayers 9 --xlayers 5 --rlayers 5 \
15
- --loadLXMERTQA snap/pretrained/model \
16
- --batchSize 32 --optim bert --lr 1e-5 --epochs 4 \
17
- --tqdm --output $output ${@:3}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lxmert/run/gqa_test.bash DELETED
@@ -1,15 +0,0 @@
1
- # The name of this experiment.
2
- name=$2
3
-
4
- # Save logs and models under snap/gqa; make backup.
5
- output=snap/gqa/$name
6
- mkdir -p $output/src
7
- cp -r src/* $output/src/
8
- cp $0 $output/run.bash
9
-
10
- # See Readme.md for option details.
11
- CUDA_VISIBLE_DEVICES=$1 PYTHONPATH=$PYTHONPATH:./src \
12
- python src/tasks/gqa.py \
13
- --tiny --train train --valid "" \
14
- --llayers 9 --xlayers 5 --rlayers 5 \
15
- --tqdm --output $output ${@:3}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lxmert/run/lxmert_pretrain.bash DELETED
@@ -1,21 +0,0 @@
1
- # The name of experiment
2
- name=lxmert
3
-
4
- # Create dirs and make backup
5
- output=snap/pretrain/$name
6
- mkdir -p $output/src
7
- cp -r src/* $output/src/
8
- cp $0 $output/run.bash
9
-
10
- # Pre-training
11
- CUDA_VISIBLE_DEVICES=$1 PYTHONPATH=$PYTHONPATH:./src \
12
- python src/pretrain/lxmert_pretrain.py \
13
- --taskMaskLM --taskObjPredict --taskMatched --taskQA \
14
- --visualLosses obj,attr,feat \
15
- --wordMaskRate 0.15 --objMaskRate 0.15 \
16
- --train mscoco_train,mscoco_nominival,vgnococo --valid mscoco_minival \
17
- --llayers 9 --xlayers 5 --rlayers 5 \
18
- --fromScratch \
19
- --batchSize 256 --optim bert --lr 1e-4 --epochs 20 \
20
- --tqdm --output $output ${@:2}
21
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lxmert/run/nlvr2_finetune.bash DELETED
@@ -1,18 +0,0 @@
1
- # The name of this experiment.
2
- name=$2
3
-
4
- # Save logs and models under snap/nlvr2; Make backup.
5
- output=snap/nlvr2/$name
6
- mkdir -p $output/src
7
- cp -r src/* $output/src/
8
- cp $0 $output/run.bash
9
-
10
- # See run/Readme.md for option details.
11
- CUDA_VISIBLE_DEVICES=$1 PYTHONPATH=$PYTHONPATH:./src \
12
- python src/tasks/nlvr2.py \
13
- --train train --valid valid \
14
- --llayers 9 --xlayers 5 --rlayers 5 \
15
- --loadLXMERT snap/pretrained/model \
16
- --batchSize 32 --optim bert --lr 5e-5 --epochs 4 \
17
- --tqdm --output $output ${@:3}
18
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lxmert/run/nlvr2_test.bash DELETED
@@ -1,14 +0,0 @@
1
- # The name of this experiment.
2
- name=$2
3
-
4
- # Save logs and models under snap/nlvr2; make backup.
5
- output=snap/nlvr2/$name
6
- mkdir -p $output/src
7
- cp -r src/* $output/src/
8
- cp $0 $output/run.bash
9
-
10
- # See Readme.md for option details.
11
- CUDA_VISIBLE_DEVICES=$1 PYTHONPATH=$PYTHONPATH:./src \
12
- python src/tasks/nlvr2.py \
13
- --tiny --llayers 9 --xlayers 5 --rlayers 5 \
14
- --tqdm --output $output ${@:3}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lxmert/run/vqa_finetune.bash DELETED
@@ -1,17 +0,0 @@
1
- # The name of this experiment.
2
- name=$2
3
-
4
- # Save logs and models under snap/vqa; make backup.
5
- output=snap/vqa/$name
6
- mkdir -p $output/src
7
- cp -r src/* $output/src/
8
- cp $0 $output/run.bash
9
-
10
- # See Readme.md for option details.
11
- CUDA_VISIBLE_DEVICES=$1 PYTHONPATH=$PYTHONPATH:./src \
12
- python src/tasks/vqa.py \
13
- --train train,nominival --valid minival \
14
- --llayers 9 --xlayers 5 --rlayers 5 \
15
- --loadLXMERTQA snap/pretrained/model \
16
- --batchSize 32 --optim bert --lr 5e-5 --epochs 4 \
17
- --tqdm --output $output ${@:3}
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
lxmert/run/vqa_test.bash DELETED
@@ -1,16 +0,0 @@
1
- # The name of this experiment.
2
- name=$2
3
-
4
- # Save logs and models under snap/vqa; make backup.
5
- output=snap/vqa/$name
6
- mkdir -p $output/src
7
- cp -r src/* $output/src/
8
- cp $0 $output/run.bash
9
-
10
- # See Readme.md for option details.
11
- CUDA_VISIBLE_DEVICES=$1 PYTHONPATH=$PYTHONPATH:./src \
12
- python src/tasks/vqa.py \
13
- --tiny --train train --valid "" \
14
- --llayers 9 --xlayers 5 --rlayers 5 \
15
- --batchSize 32 --optim bert --lr 5e-5 --epochs 4 \
16
- --tqdm --output $output ${@:3}