Skip to content

Commit

Permalink
itm training with hard negatives
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenRocks committed Aug 7, 2020
1 parent 06783be commit 4d9f935
Show file tree
Hide file tree
Showing 3 changed files with 528 additions and 0 deletions.
45 changes: 45 additions & 0 deletions config/train-itm-coco-base-16gpu-hn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
{
"compressed_db": false,
"checkpoint": "/pretrain/uniter-base.pt",
"output_dir": "/storage/itm/coco/hard_neg",
"max_txt_len": 60,
"conf_th": 0.2,
"max_bb": 100,
"min_bb": 10,
"num_bb": 36,
"train_batch_size": 8,
"negative_size": 399,
"hard_neg_size": 31,
"inf_minibatch_size": 400,
"margin": 0.2,
"learning_rate": 5e-05,
"valid_steps": 500,
"num_train_steps": 5000,
"optim": "adamw",
"betas": [
0.9,
0.98
],
"dropout": 0.1,
"weight_decay": 0.01,
"grad_norm": 2.0,
"warmup_steps": 500,
"seed": 42,
"full_val": true,
"fp16": true,
"n_workers": 4,
"pin_mem": true,
"train_txt_dbs": [
"/txt/itm_coco_train.db",
"/txt/itm_coco_restval.db"
],
"train_img_dbs": [
"/img/coco_train2014/",
"/img/coco_val2014"
],
"val_txt_db": "/txt/itm_coco_val.db",
"val_img_db": "/img/coco_val2014/",
"test_txt_db": "/txt/itm_coco_test.db",
"test_img_db": "/img/coco_val2014/",
"model_config": "/src/config/uniter-base.json"
}
43 changes: 43 additions & 0 deletions config/train-itm-flickr-base-16gpu-hn.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"compressed_db": false,
"checkpoint": "/pretrain/uniter-base.pt",
"output_dir": "/storage/itm/flickr/hard_neg",
"max_txt_len": 60,
"conf_th": 0.2,
"max_bb": 100,
"min_bb": 10,
"num_bb": 36,
"train_batch_size": 8,
"negative_size": 399,
"hard_neg_size": 31,
"inf_minibatch_size": 400,
"margin": 0.2,
"learning_rate": 5e-05,
"valid_steps": 500,
"num_train_steps": 5000,
"optim": "adamw",
"betas": [
0.9,
0.98
],
"dropout": 0.1,
"weight_decay": 0.01,
"grad_norm": 2.0,
"warmup_steps": 500,
"seed": 42,
"full_val": true,
"fp16": true,
"n_workers": 4,
"pin_mem": true,
"train_txt_dbs": [
"/txt/itm_flickr30k_train.db"
],
"train_img_dbs": [
"/img/flickr30k/"
],
"val_txt_db": "/txt/itm_flickr30k_val.db",
"val_img_db": "/img/flickr30k/",
"test_txt_db": "/txt/itm_flickr30k_test.db",
"test_img_db": "/img/flickr30k/",
"model_config": "/src/config/uniter-base.json"
}
Loading

0 comments on commit 4d9f935

Please sign in to comment.