-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathtrain_h.sh
98 lines (97 loc) · 3.01 KB
/
train_h.sh
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
GPU_id=4
module="3d1" #3_no_c, 3_no_p, 3d1, 3d2, 3d3,3d1w2,3d1w4
id="h_v"$module
caption_model="aoa"$module
refine_aoa=1
aoa_num=4 # 6 is set in AOA, -1 , -2, and -3 are only for ablation study "l1" "l2" and "l3"
#word_count_threshold=4
if [ ! -f log/log_$id/infos_$id.pkl ]; then
start_from=""
else
start_from="--start_from log/tmp/train_ours/log_$id"
fi
# start_from=""
# start_from="--start_from log/tmp/train_ours/log_refine_aoa_${id}_aoa${aoa_num}"
# echo $word_count_threshold
# echo $start_from
# CUDA_VISIBLE_DEVICES=$GPU_id
# python train_h.py --id $id --refine_aoa $refine_aoa --caption_model $caption_model --aoa_num $aoa_num\
# --caption_model $caption_model \
# --refine 1 \
# --refine_aoa $refine_aoa \
# --aoa_num $aoa_num\
# --use_ff 0 \
# --decoder_type AoA \
# --use_multi_head 2 \
# --num_heads 8 \
# --multi_head_scale 1 \
# --mean_feats 1 \
# --ctx_drop 1 \
# --dropout_aoa 0.3 \
# --label_smoothing 0.2 \
# --input_json data/tmp/4/cocotalk.json \
# --input_label_h5 data/tmp/4/cocotalk_label.h5 \
# --input_fc_dir /phys/ssd/liao/adaptive/cocobu_fc \
# --input_att_dir /phys/ssd/liao/adaptive/cocobu_att \
# --input_box_dir /phys/ssd/liao/adaptive/cocobu_box \
# --input_flag_dir data/tmp/cocobu_flag_h_v1 \
# --seq_per_img 5 \
# --batch_size 10 \
# --beam_size 1 \
# --learning_rate 2e-4 \
# --num_layers 2 \
# --input_encoding_size 1024 \
# --rnn_size 1024 \
# --learning_rate_decay_start 0 \
# --scheduled_sampling_start 0 \
# --name_append "30"\
# --checkpoint_path log/tmp/train_ours/log_refine_aoa_${id}_aoa${aoa_num}\
# $start_from \
# --save_checkpoint_every 5000 \
# --language_eval 1 \
# --val_images_use -1 \
# --max_epochs 45 \
# --scheduled_sampling_increase_every 5 \
# --scheduled_sampling_max_prob 0.5 \
# --learning_rate_decay_every 3 \
# --use_warmup 0
python train_h.py --id $id --refine_aoa $refine_aoa --caption_model $caption_model --aoa_num $aoa_num\
--caption_model $caption_model \
--refine 1 \
--refine_aoa $refine_aoa \
--aoa_num $aoa_num\
--use_ff 0 \
--decoder_type AoA \
--use_multi_head 2 \
--num_heads 8 \
--multi_head_scale 1 \
--mean_feats 1 \
--ctx_drop 1 \
--dropout_aoa 0.3 \
--input_json data/tmp/4/cocotalk.json \
--input_label_h5 data/tmp/4/cocotalk_label.h5 \
--input_fc_dir /phys/ssd/liao/adaptive/cocobu_fc \
--input_att_dir /phys/ssd/liao/adaptive/cocobu_att \
--input_box_dir /phys/ssd/liao/adaptive/cocobu_box \
--input_flag_dir data/tmp/cocobu_flag_h_v1 \
--seq_per_img 5 \
--batch_size 10 \
--beam_size 1 \
--num_layers 2 \
--input_encoding_size 1024 \
--rnn_size 1024 \
--language_eval 1 \
--val_images_use -1 \
--save_checkpoint_every 5000 \
--name_append "interrupt"\
--start_from log/tmp/train_ours/log_refine_aoa_${id}_aoa${aoa_num}_rl\
--checkpoint_path log/tmp/train_ours/log_refine_aoa_${id}_aoa${aoa_num}_rl\
--learning_rate 2e-5 \
--max_epochs 60 \
--self_critical_after 0 \
--learning_rate_decay_start -1 \
--scheduled_sampling_start -1 \
--reduce_on_plateau \
--use_val 0 \
--use_test 0 \
--refine_lr_decay 1\