-
Notifications
You must be signed in to change notification settings - Fork 0
/
search.sh
executable file
·125 lines (116 loc) · 4.01 KB
/
search.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
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
OBJECTIVE="test_HR@10"
# datamodule
TOKENIZED_LEN=30
NUM_WORKERS=10
MIN_ITEM_SEQ_LEN=5
MAX_ITEM_SEQ_LEN="None"
# prompt
USE_PROMPT="False"
PRE_SEQ_LEN=5
POST_SEQ_LEN=0
LAST_QUERY_LEN=0
PROMPT_PROJECTION="nonlinear"
PROMPT_HIDDEN_SIZE=256
# sasrec
SASREC_SEQ_LEN=20
SASREC_N_LAYERS=2
SASREC_N_HEADS=2
LAYER_NORM_EPS=1e-6
DROPOUT=0.1
INITIALIZER_RANGE=0.02
# dssm
N_NEG_SAMPLING=1
# text encoder
POOLING_METHOD="mean"
PRETRAINED_MODEL="facebook/opt-125m"
PLM_LR=5e-5
PLM_LR_LAYER_DECAY=0.8
PLM_WEIGHT_DECAY=0.0
PROJECTION_N_LAYERS=1
PROJECTION_INNER_SIZES=""
# pre-inference
PRE_INFERENCE_BATCH_SIZE=1
PRE_INFERENCE_DEVICES="4 5 6 7"
PRE_INFERENCE_NUM_WORKERS=0
PRE_INFERENCE_PRECISION=32
PRE_INFERENCE_LAYER_WISE="False"
# trainer
INPUT_TYPE="text"
ARCHITECTURE="sasrec"
DATASET="MIND_large"
SPLIT_TYPE="ratio"
SAMPLING_N="none"
PRE_INFERENCE="True"
UNFREEZE=0
CHECK_VAL_EVERY_N_EPOCH=2
TOPK_LIST="5 10 20"
MAX_EPOCHS=150
EARLY_STOPPING=5
PRECISION=16
ACCELERATOR="gpu"
STRATEGY="none"
DEVICES="7"
# 1e-5 7e-5 1e-4 5e-4 1e-3
# 0.0 0.01 0.1
for dim in 512
do
for lr in 1e-4
do
for wd in 0.1
do
for bs in 64
do
python3 run.py --input_type $INPUT_TYPE \
--max_epochs $MAX_EPOCHS \
--early_stop_patience $EARLY_STOPPING \
--batch_size $bs \
--num_workers $NUM_WORKERS \
--devices $DEVICES \
--accelerator $ACCELERATOR \
--precision $PRECISION \
--dataset $DATASET \
--min_item_seq_len $MIN_ITEM_SEQ_LEN \
--max_item_seq_len $MAX_ITEM_SEQ_LEN \
--sasrec_seq_len $SASREC_SEQ_LEN \
--lr $lr \
--weight_decay $wd \
--sasrec_hidden_size $dim \
--sasrec_inner_size $[4*dim] \
--sasrec_n_layers $SASREC_N_LAYERS \
--sasrec_n_heads $SASREC_N_HEADS \
--sasrec_layer_norm_eps $LAYER_NORM_EPS \
--sasrec_hidden_dropout $DROPOUT \
--sasrec_attention_dropout $DROPOUT \
--sasrec_initializer_range $INITIALIZER_RANGE \
--topk_list $TOPK_LIST \
--tokenized_len $TOKENIZED_LEN \
--plm_name $PRETRAINED_MODEL \
--plm_last_n_unfreeze $UNFREEZE \
--projection_n_layers $PROJECTION_N_LAYERS \
--projection_inner_sizes $PROJECTION_INNER_SIZES \
--use_prompt $USE_PROMPT \
--prompt_projection $PROMPT_PROJECTION \
--prompt_hidden_size $PROMPT_HIDDEN_SIZE \
--pre_seq_len $PRE_SEQ_LEN \
--pooling_method $POOLING_METHOD \
--post_seq_len $POST_SEQ_LEN \
--last_query_len $LAST_QUERY_LEN \
--plm_lr $PLM_LR \
--plm_lr_layer_decay $PLM_LR_LAYER_DECAY \
--plm_weight_decay $PLM_WEIGHT_DECAY \
--strategy $STRATEGY \
--pre_inference $PRE_INFERENCE \
--pre_inference_batch_size $PRE_INFERENCE_BATCH_SIZE \
--pre_inference_devices $PRE_INFERENCE_DEVICES \
--pre_inference_precision $PRE_INFERENCE_PRECISION \
--pre_inference_num_workers $PRE_INFERENCE_NUM_WORKERS \
--pre_inference_layer_wise $PRE_INFERENCE_LAYER_WISE \
--split_type $SPLIT_TYPE \
--check_val_every_n_epoch $CHECK_VAL_EVERY_N_EPOCH \
--architecture $ARCHITECTURE \
--n_neg_sampling $N_NEG_SAMPLING \
--sampling_n $SAMPLING_N
done
done
done
done