-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwikitext_bpe_alteval.sh
78 lines (69 loc) · 3.91 KB
/
wikitext_bpe_alteval.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
# LM 3072, context-window 2560, none
## eval train
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode none --max-tokens 3072 --softmax-batch 1024 \
--gen-subset train --bpe subword_nmt --remove-bpe \
--save-tokens overfit_analysis/train_tokens.npy --save-scores overfit_analysis/train_lm_scores.npy
## eval valid
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode none --max-tokens 3072 --softmax-batch 1024 \
--gen-subset valid --bpe subword_nmt --remove-bpe \
--save-tokens overfit_analysis/tokens.npy --save-scores overfit_analysis/lm_scores.npy
## eval with KNN
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode none --max-tokens 3072 --softmax-batch 1024 \
--gen-subset valid --dstore-filename checkpoints/wikitext103-bpe/dstore \
--indexfile checkpoints/wikitext103-bpe/knn_prune.index \
--model-overrides "{'knn_keytype': 'last_ffn_input'}" \
--k 1024 --lmbda 0.25 --dstore-size 153225485 --knn-keytype last_ffn_input \
--knn-sim-func "do_not_recomp_l2" --no-load-keys \
--probe 32 --knnlm --fp16 --dstore-fp16 --bpe subword_nmt --remove-bpe \
--save-knn-scores overfit_analysis/knn_scores.npy
## eval with KNN recomp
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode none --max-tokens 3072 --softmax-batch 1024 \
--gen-subset valid --dstore-filename checkpoints/wikitext103-bpe/dstore \
--indexfile checkpoints/wikitext103-bpe/knn_prune.index \
--model-overrides "{'knn_keytype': 'last_ffn_input'}" \
--k 1024 --lmbda 0.25 --dstore-size 153225485 --knn-keytype last_ffn_input \
--probe 32 --knnlm --fp16 --dstore-fp16 --bpe subword_nmt --remove-bpe \
--save-knn-scores overfit_analysis/knn_recomp_scores.npy
## eval with KNN ip
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode none --max-tokens 3072 --softmax-batch 1024 \
--gen-subset valid --dstore-filename checkpoints/wikitext103-bpe/dstore \
--indexfile checkpoints/wikitext103-bpe/knn_ip.index --faiss-metric-type ip \
--model-overrides "{'knn_keytype': 'last_ffn_input'}" \
--k 1024 --lmbda 0.25 --dstore-size 153225485 --knn-keytype last_ffn_input \
--no-load-keys \
--probe 32 --knnlm --fp16 --dstore-fp16 --bpe subword_nmt --remove-bpe \
--save-knn-scores overfit_analysis/knn_ip_scores.npy
## eval with KNN ip recomp
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode none --max-tokens 3072 --softmax-batch 1024 \
--gen-subset valid --dstore-filename checkpoints/wikitext103-bpe/dstore \
--indexfile checkpoints/wikitext103-bpe/knn_ip.index --faiss-metric-type ip \
--model-overrides "{'knn_keytype': 'last_ffn_input'}" \
--k 1024 --lmbda 0.25 --dstore-size 153225485 --knn-keytype last_ffn_input \
--knn-sim-func "dot" \
--probe 32 --knnlm --fp16 --dstore-fp16 --bpe subword_nmt --remove-bpe \
--save-knn-scores overfit_analysis/knn_ip_recomp_scores.npy
# overfitted model
## eval train
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe-overfit-new/checkpoint129.pt \
--sample-break-mode none --max-tokens 3072 --softmax-batch 1024 \
--gen-subset train --bpe subword_nmt --remove-bpe \
--save-scores overfit_analysis/train_overfit129_lm_scores.npy
## eval valid
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe-overfit-new/checkpoint129.pt \
--sample-break-mode none --max-tokens 3072 --softmax-batch 1024 \
--gen-subset valid --bpe subword_nmt --remove-bpe \
--save-scores overfit_analysis/overfit129_lm_scores.npy