-
Notifications
You must be signed in to change notification settings - Fork 2
/
train_rel_class.sh
executable file
·69 lines (64 loc) · 1.68 KB
/
train_rel_class.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
#!/usr/bin/env bash
set -ex
TRAIN_FILE=./data/relation/touche-train.tsv
TEST_FILE=./data/relation/touche-test.tsv
VALIDATION_FILE=./data/relation/touche-validation.tsv
OUTPUT_DIR=./output
TASK_TYPE=rel-class
MODEL=deberta-v3
EXPERIMENT_NAME=touche23-valueeval
RUN_NAME=deberta-v3-model
LABELS="noRel Attack Support"
RELEVANT_LABELS="Attack Support"
EPOCHS=5
EARLY_STOP=2
TRAIN_BATCH_SIZE=32
EVAL_BATCH_SIZE=32
GRADIENT_ACCUMULATION=1
MAX_GRAD=1
MAX_SEQ_LENGTH=128
LEARNING_RATE=2e-5
WEIGHT_DECAY=0
WARMUP_STEPS=0
LOG_STEPS=180
SAVE_STEPS=360
RANDOM_SEED=42
python ./scripts/train.py \
--train-data $TRAIN_FILE \
--validation-data $VALIDATION_FILE \
--output-dir $OUTPUT_DIR \
--task-type $TASK_TYPE \
--model $MODEL \
--experiment-name $EXPERIMENT_NAME \
--run-name $RUN_NAME \
--labels $LABELS \
--num-devices -1 \
--num-workers -1 \
--epochs $EPOCHS \
--early-stopping $EARLY_STOP \
--batch-size $TRAIN_BATCH_SIZE \
--gradient-accumulation-steps $GRADIENT_ACCUMULATION \
--max-grad-norm $MAX_GRAD \
--max-seq-length $MAX_SEQ_LENGTH \
--learning-rate $LEARNING_RATE \
--weight-decay $WEIGHT_DECAY \
--warmup-steps $WARMUP_STEPS \
--weighted-loss \
--log-every-n-steps $LOG_STEPS \
--save-every-n-steps $SAVE_STEPS \
--random-seed $RANDOM_SEED
python ./scripts/eval.py \
--test-data $TEST_FILE \
--output-dir $OUTPUT_DIR \
--task-type $TASK_TYPE \
--model $MODEL \
--experiment-name $EXPERIMENT_NAME \
--run-name $RUN_NAME \
--eval-all-checkpoints \
--labels $LABELS \
--relevant-labels $RELEVANT_LABELS \
--num-workers -1 \
--batch-size $EVAL_BATCH_SIZE \
--max-seq-length $MAX_SEQ_LENGTH \
--weighted-loss \
--random-seed $RANDOM_SEED