-
Notifications
You must be signed in to change notification settings - Fork 12
Expand file tree
/
Copy pathpredict.sh
More file actions
160 lines (148 loc) · 4.53 KB
/
predict.sh
File metadata and controls
160 lines (148 loc) · 4.53 KB
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
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
#!/usr/bin/env bash
ROOT_DIR="${HOME}/Data"
DATA_DIR=${ROOT_DIR}
OUTPUT_DIR=${ROOT_DIR}/output
PRETRAINED_MODEL_PATH="${ROOT_DIR}/bert/roberta_large"
# Roberta_large-v3.4
FILE_STATE_DICT="${HOME}/Data/output/roberta_large-v3.4-one_tower-cls-NA-ce/text_finetune_epoch-9.bin"
python finetune_text.py \
--data_dir $DATA_DIR \
--output_dir $OUTPUT_DIR \
--model_name "roberta_large" \
--data_version "v3.4" \
--pretrained_model_path $PRETRAINED_MODEL_PATH \
--file_state_dict $FILE_STATE_DICT \
--config_file "src/config/roberta_large.json" \
--do_pred \
--interaction_type "one_tower" \
--classification_method "cls" \
--similarity_measure "NA" \
--loss_type "ce" \
--max_seq_len 50 \
--max_seq_len_pv 205 \
--eval_batch_size 108 \
--threshold 0.4 \
--fp16
# Roberta_large-v3.4-cls_cat_1,2,3,4
FILE_STATE_DICT="${HOME}/Data/output/roberta_large-v3.4-one_tower-cls_1,2,3,4_cat-NA-ce/text_finetune_epoch-9.bin"
python finetune_text.py \
--data_dir $DATA_DIR \
--output_dir $OUTPUT_DIR \
--model_name "roberta_large" \
--data_version "v3.4" \
--pretrained_model_path $PRETRAINED_MODEL_PATH \
--file_state_dict $FILE_STATE_DICT \
--config_file "src/config/roberta_large.json" \
--do_pred \
--interaction_type "one_tower" \
--classification_method "cls_1,2,3,4_cat" \
--similarity_measure "NA" \
--loss_type "ce" \
--cls_layers "1,2,3,4" \
--cls_pool "cat" \
--max_seq_len 50 \
--max_seq_len_pv 205 \
--eval_batch_size 108 \
--threshold 0.4 \
--fp16
# Roberta_large-v4
FILE_STATE_DICT="${HOME}/Data/output/roberta_large-v4-one_tower-cls-NA-ce/text_finetune_epoch-9.bin"
python finetune_text.py \
--data_dir $DATA_DIR \
--output_dir $OUTPUT_DIR \
--model_name "roberta_large" \
--data_version "v4" \
--pretrained_model_path $PRETRAINED_MODEL_PATH \
--file_state_dict $FILE_STATE_DICT \
--config_file "src/config/roberta_large.json" \
--do_pred \
--interaction_type "one_tower" \
--classification_method "cls" \
--similarity_measure "NA" \
--loss_type "ce" \
--max_seq_len 50 \
--max_seq_len_pv 205 \
--eval_batch_size 108 \
--threshold 0.4 \
--fp16
# pkgm_large-v3.4
FILE_STATE_DICT="${HOME}/Data/output/pkgm_large-v3.4-one_tower-cls-NA-ce/text_finetune_epoch-9.bin"
python finetune_text.py \
--data_dir $DATA_DIR \
--output_dir $OUTPUT_DIR \
--model_name "pkgm_large" \
--data_version "v3.4" \
--pretrained_model_path $PRETRAINED_MODEL_PATH \
--file_state_dict $FILE_STATE_DICT \
--config_file "src/config/pkgm_large.json" \
--do_pred \
--interaction_type "one_tower" \
--classification_method "cls" \
--similarity_measure "NA" \
--loss_type "ce" \
--max_seq_len 64 \
--max_pvs 30 \
--eval_batch_size 512 \
--threshold 0.4 \
--fp16
# textcnn-v3.4
FILE_STATE_DICT="${HOME}/Data/output/textcnn-v3.4-two_tower-cls-NA-ce/text_finetune_epoch-9.bin"
python finetune_text.py \
--data_dir $DATA_DIR \
--output_dir $OUTPUT_DIR \
--model_name "textcnn" \
--data_version "v3.4" \
--pretrained_model_path $PRETRAINED_MODEL_PATH \
--file_state_dict $FILE_STATE_DICT \
--config_file "src/config/roberta_large.json" \
--do_pred \
--interaction_type "two_tower" \
--classification_method "cls" \
--similarity_measure "NA" \
--loss_type "ce" \
--max_seq_len 50 \
--max_seq_len_pv 205 \
--eval_batch_size 512 \
--threshold 0.4 \
--fp16
# bert_base
python pred_bert.py
# roberta_image_large-v5
FILE_STATE_DICT="${HOME}/Data/output/roberta_image_large-v5-one_tower-cls-begin-ce/multimodal_finetune_epoch-9.bin"
python finetune_multimodal.py \
--data_dir $DATA_DIR \
--output_dir $OUTPUT_DIR \
--model_name "roberta_image_large" \
--data_version "v5" \
--config_file "src/config/roberta_image_large.json" \
--pretrained_model_path $PRETRAINED_MODEL_PATH \
--file_state_dict $FILE_STATE_DICT \
--do_pred \
--interaction_type "one_tower" \
--classification_method "cls" \
--ensemble "begin" \
--loss_type "ce" \
--max_seq_len 50 \
--max_seq_len_pv 205 \
--eval_batch_size 108 \
--threshold 0.4 \
--fp16
# eca_nfnet_l0-v6
FILE_STATE_DICT="${HOME}/Data/output/eca_nfnet_l0-v6/image_finetune_epoch-9.bin"
python finetune_image.py \
--data_dir $DATA_DIR/raw \
--output_dir $OUTPUT_DIR \
--model_name "eca_nfnet_l0" \
--data_version "v6" \
--config_file "src/config/eca_nfnet_l0.json" \
--file_state_dict $FILE_STATE_DICT \
--do_pred \
--image_size 1000 \
--eval_batch_size 128 \
--threshold 0.4 \
--fp16
# model ensemble
python model_ensemble.py \
--data_dir $DATA_DIR \
--ensemble_strategy "threshold" \
--split_by_valid_or_test