-
Notifications
You must be signed in to change notification settings - Fork 0
/
runs_wo_adv_sum.sh
executable file
·77 lines (62 loc) · 1.88 KB
/
runs_wo_adv_sum.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
#!/bin/sh
python -u -c 'import torch; print(torch.__version__)'
CODE_PATH=codes
DATA_PATH=data
SAVE_PATH=models
#The first four parameters must be provided
MODE=$1
MODEL=$2
DATASET=$3
GPU_DEVICE=$4
SAVE_ID=$5
FULL_DATA_PATH=$DATA_PATH/$DATASET
SAVE=$SAVE_PATH/"$MODEL"_"$DATASET"_"$SAVE_ID"
#Only used in training
BATCH_SIZE=$6
NEGATIVE_SAMPLE_SIZE=$7
HIDDEN_DIM=$8
GAMMA=$9
ALPHA=${10}
LEARNING_RATE=${11}
MAX_STEPS=${12}
TEST_BATCH_SIZE=${13}
MODULUS_WEIGHT=${14}
PHASE_WEIGHT=${15}
if [ $MODE == "train" ]
then
echo "Start Training......"
if [ $MODEL == "HAKE" ]
then
CUDA_VISIBLE_DEVICES=$GPU_DEVICE python -u $CODE_PATH/runs.py --do_train \
--do_valid \
--do_test \
--data_path $FULL_DATA_PATH \
--model $MODEL \
-n $NEGATIVE_SAMPLE_SIZE -b $BATCH_SIZE -d $HIDDEN_DIM \
-g $GAMMA -a $ALPHA -sum \
-lr $LEARNING_RATE --max_steps $MAX_STEPS \
-save $SAVE --test_batch_size $TEST_BATCH_SIZE \
-mw $MODULUS_WEIGHT -pw $PHASE_WEIGHT ${16}
elif [ $MODEL == "ModE" ]
then
CUDA_VISIBLE_DEVICES=$GPU_DEVICE python -u $CODE_PATH/runs.py --do_train \
--do_valid \
--do_test \
--data_path $FULL_DATA_PATH \
--model $MODEL \
-n $NEGATIVE_SAMPLE_SIZE -b $BATCH_SIZE -d $HIDDEN_DIM \
-g $GAMMA -a $ALPHA -sum \
-lr $LEARNING_RATE --max_steps $MAX_STEPS \
-save $SAVE --test_batch_size $TEST_BATCH_SIZE ${16}
fi
elif [ $MODE == "valid" ]
then
echo "Start Evaluation on Valid Data Set......"
CUDA_VISIBLE_DEVICES=$GPU_DEVICE python -u $CODE_PATH/runs.py --do_valid -init $SAVE
elif [ $MODE == "test" ]
then
echo "Start Evaluation on Test Data Set......"
CUDA_VISIBLE_DEVICES=$GPU_DEVICE python -u $CODE_PATH/runs.py --do_test -init $SAVE
else
echo "Unknown MODE" $MODE
fi