-
Notifications
You must be signed in to change notification settings - Fork 3
/
wikitext_bpe_load_perword.sh
60 lines (55 loc) · 3.21 KB
/
wikitext_bpe_load_perword.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
# last_ffn_input
## eval - random sample 2 per word
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode complete --max-tokens 3072 \
--context-window 2560 --softmax-batch 1024 \
--gen-subset valid --bpe subword_nmt --remove-bpe \
--model-overrides "{'knn_keytype': 'last_ffn_input', 'use_last_ffn_input': True}" \
--load-centroids checkpoints/wikitext103-bpe/rsample.npy \
--load-centroid-distribution checkpoints/wikitext103-bpe/rsample_freq.npz
# use_l2 random sample 2 per word
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode complete --max-tokens 3072 \
--context-window 2560 --softmax-batch 1024 \
--gen-subset valid --bpe subword_nmt --remove-bpe \
--model-overrides "{'knn_keytype': 'last_ffn_input', 'use_last_ffn_input': True, 'use_l2': True}" \
--load-centroids checkpoints/wikitext103-bpe/rsample.npy \
--load-centroid-distribution checkpoints/wikitext103-bpe/rsample_freq.npz
## eval - kmeans k=2 per word
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode complete --max-tokens 3072 \
--context-window 2560 --softmax-batch 1024 \
--gen-subset valid --bpe subword_nmt --remove-bpe \
--model-overrides "{'knn_keytype': 'last_ffn_input', 'use_last_ffn_input': True}" \
--load-centroids checkpoints/wikitext103-bpe/kmeans_2perword.npy \
--load-centroid-distribution checkpoints/wikitext103-bpe/kmeans_2perword_freq.npz
# use_l2 kmeans k=2 per word
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode complete --max-tokens 3072 \
--context-window 2560 --softmax-batch 1024 \
--gen-subset valid --bpe subword_nmt --remove-bpe \
--model-overrides "{'knn_keytype': 'last_ffn_input', 'use_last_ffn_input': True, 'use_l2': True}" \
--load-centroids checkpoints/wikitext103-bpe/kmeans_2perword.npy \
--load-centroid-distribution checkpoints/wikitext103-bpe/kmeans_2perword_freq.npz
## eval - kmeans adaptive per word
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode complete --max-tokens 3072 \
--context-window 2560 --softmax-batch 1024 \
--gen-subset valid --bpe subword_nmt --remove-bpe \
--model-overrides "{'knn_keytype': 'last_ffn_input', 'use_last_ffn_input': True}" \
--load-centroids checkpoints/wikitext103-bpe/kmeans_adaptive.npy \
--load-centroid-distribution checkpoints/wikitext103-bpe/kmeans_adaptive_freq.npz
# use_l2 kmeans adaptive per word
python eval_lm.py data-bin/wikitext103-bpe \
--path checkpoints/wikitext103-bpe/checkpoint_best.pt \
--sample-break-mode complete --max-tokens 3072 \
--context-window 2560 --softmax-batch 1024 \
--gen-subset valid --bpe subword_nmt --remove-bpe \
--model-overrides "{'knn_keytype': 'last_ffn_input', 'use_last_ffn_input': True, 'use_l2': True}" \
--load-centroids checkpoints/wikitext103-bpe/kmeans_adaptive.npy \
--load-centroid-distribution checkpoints/wikitext103-bpe/kmeans_adaptive_freq.npz