HaileyStorm
commited on
Commit
•
2649aea
1
Parent(s):
c84d6ba
Upload folder using huggingface_hub
Browse files- chess-gpt-eval-contrastive/__pycache__/gpt_query.cpython-310.pyc +0 -0
- chess-gpt-eval-contrastive/__pycache__/mamba.cpython-310.pyc +0 -0
- chess-gpt-eval-contrastive/__pycache__/mamba_lm.cpython-310.pyc +0 -0
- chess-gpt-eval-contrastive/__pycache__/mamba_module.cpython-310.pyc +0 -0
- chess-gpt-eval-contrastive/__pycache__/pscan.cpython-310.pyc +0 -0
- chess-gpt-eval-contrastive/activations_rdm.pkl +3 -0
- chess-gpt-eval-contrastive/game.txt +1 -1
- chess-gpt-eval-contrastive/lc0.zip +3 -0
- chess-gpt-eval-contrastive/lc0/build/release/meson-private/build.dat +0 -0
- chess-gpt-eval-contrastive/lc0/build/release/meson-private/coredata.dat +0 -0
- chess-gpt-eval-contrastive/logs/contrastive/mamba_rdm_35_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_10_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_15_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_20_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_25_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_30_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_35_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_weights/mamba_contrastive_wgt_1_4_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_005_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_01_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_025_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_05_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_1_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_25_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_4_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/logs/random/mamba_rdm_10_vs_lc0_sweep.csv +0 -0
- chess-gpt-eval-contrastive/main.py +12 -9
- chess-gpt-eval-contrastive/mamba_module.py +6 -1
- chess-gpt-eval-contrastive/nanogpt/__pycache__/model.cpython-310.pyc +0 -0
- chess-gpt-eval-contrastive/nanogpt/__pycache__/nanogpt_module.cpython-310.pyc +0 -0
chess-gpt-eval-contrastive/__pycache__/gpt_query.cpython-310.pyc
CHANGED
Binary files a/chess-gpt-eval-contrastive/__pycache__/gpt_query.cpython-310.pyc and b/chess-gpt-eval-contrastive/__pycache__/gpt_query.cpython-310.pyc differ
|
|
chess-gpt-eval-contrastive/__pycache__/mamba.cpython-310.pyc
CHANGED
Binary files a/chess-gpt-eval-contrastive/__pycache__/mamba.cpython-310.pyc and b/chess-gpt-eval-contrastive/__pycache__/mamba.cpython-310.pyc differ
|
|
chess-gpt-eval-contrastive/__pycache__/mamba_lm.cpython-310.pyc
CHANGED
Binary files a/chess-gpt-eval-contrastive/__pycache__/mamba_lm.cpython-310.pyc and b/chess-gpt-eval-contrastive/__pycache__/mamba_lm.cpython-310.pyc differ
|
|
chess-gpt-eval-contrastive/__pycache__/mamba_module.cpython-310.pyc
CHANGED
Binary files a/chess-gpt-eval-contrastive/__pycache__/mamba_module.cpython-310.pyc and b/chess-gpt-eval-contrastive/__pycache__/mamba_module.cpython-310.pyc differ
|
|
chess-gpt-eval-contrastive/__pycache__/pscan.cpython-310.pyc
CHANGED
Binary files a/chess-gpt-eval-contrastive/__pycache__/pscan.cpython-310.pyc and b/chess-gpt-eval-contrastive/__pycache__/pscan.cpython-310.pyc differ
|
|
chess-gpt-eval-contrastive/activations_rdm.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:008a1e19f824f56a052951dbef3dde6bb7923ea6a72efc9aa74b49a895092610
|
3 |
+
size 1824540820
|
chess-gpt-eval-contrastive/game.txt
CHANGED
@@ -1 +1 @@
|
|
1 |
-
.e4
|
|
|
1 |
+
.e4 Nf6 .Bb5 Rg8 .b4 b6 .f4 Rh8 .Be2 b5 .Nf3 d5 .g4 Nbd7 .Rf1 e5 .d4 Nxg4 .Rf2 Nxf2 .Kxf2 dxe4 .Nxe5 Nxe5 .dxe5 Qxd1 .Bxd1 Bxb4 .c3 Bc5+ .Ke2 Bg4+ .Ke1 Bxd1 .Kxd1 O-O-O+ .Ke1 e3 .
|
chess-gpt-eval-contrastive/lc0.zip
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:31520ad0cb827890e445ff924e974819284150a4106a7df5c6ff28b8029555b0
|
3 |
+
size 1337758181
|
chess-gpt-eval-contrastive/lc0/build/release/meson-private/build.dat
ADDED
Binary file (229 kB). View file
|
|
chess-gpt-eval-contrastive/lc0/build/release/meson-private/coredata.dat
ADDED
Binary file (92.8 kB). View file
|
|
chess-gpt-eval-contrastive/logs/contrastive/mamba_rdm_35_vs_lc0_sweep.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_10_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_15_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_20_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_25_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_30_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_35_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_learning_rdm_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_weights/mamba_contrastive_wgt_1_4_vs_lc0_sweep.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_005_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_01_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_025_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_05_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_1_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_25_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/contrastive_weights_rdm/mamba_rdm_wgt_0_4_vs_lc0_sweep.csv
ADDED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/logs/random/mamba_rdm_10_vs_lc0_sweep.csv
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
chess-gpt-eval-contrastive/main.py
CHANGED
@@ -672,18 +672,21 @@ recording_file = "logs/determine.csv" # default recording file. Because we are u
|
|
672 |
player_ones = ["50M/anneal/anneal_complete_round3.pt"]
|
673 |
player_two_recording_name = "lc0_sweep" #"stockfish_sweep"
|
674 |
move_num_in_gamestate = False
|
675 |
-
book_opening =
|
676 |
random_opening = True
|
677 |
-
|
678 |
-
activations_path="
|
679 |
-
update_activations =
|
680 |
save_activations_every = 25
|
|
|
681 |
if __name__ == "__main__":
|
682 |
for nanogpt_player in player_ones:
|
683 |
i = 0
|
684 |
-
|
685 |
-
|
686 |
-
|
|
|
|
|
687 |
# player_one = GPTPlayer(model="gpt-3.5-turbo-instruct")
|
688 |
# player_one = LocalLlamaPlayer(model_name="meta-llama/Llama-2-7b-hf")
|
689 |
# player_one = LocalLoraLlamaPlayer("meta-llama/Llama-2-7b-hf", "/workspace/axolotl/lora2-out")
|
@@ -694,9 +697,9 @@ if __name__ == "__main__":
|
|
694 |
# player_one = NanoGptPlayer(model_name=player_one_recording_name, move_num_in_gamestate=move_num_in_gamestate)
|
695 |
#player_one_recording_name = f"xformer_rdm_{rm}"
|
696 |
player_one = MambaPlayer(model_name=player_one_recording_name, move_num_in_gamestate=move_num_in_gamestate)
|
697 |
-
player_one_recording_name = f
|
698 |
if not update_activations:
|
699 |
-
player_one.apply_contrastive_activations(weight=
|
700 |
|
701 |
#player_two = StockfishPlayer(skill_level=i, play_time=0.1)
|
702 |
player_two = LC0PLayer(skill=i)
|
|
|
672 |
player_ones = ["50M/anneal/anneal_complete_round3.pt"]
|
673 |
player_two_recording_name = "lc0_sweep" #"stockfish_sweep"
|
674 |
move_num_in_gamestate = False
|
675 |
+
book_opening = False
|
676 |
random_opening = True
|
677 |
+
random_opening_moves = 10
|
678 |
+
activations_path="activations_rdm.pkl"
|
679 |
+
update_activations = False # False = use them
|
680 |
save_activations_every = 25
|
681 |
+
contrastive_weight = 0.8
|
682 |
if __name__ == "__main__":
|
683 |
for nanogpt_player in player_ones:
|
684 |
i = 0
|
685 |
+
rm = 10
|
686 |
+
# for rm in range(5, 36, 5):
|
687 |
+
# for i in [0]: # [3] #range(11):
|
688 |
+
for wgt in [0.005, 0.01, 0.025, 0.05]:
|
689 |
+
num_games = 250
|
690 |
# player_one = GPTPlayer(model="gpt-3.5-turbo-instruct")
|
691 |
# player_one = LocalLlamaPlayer(model_name="meta-llama/Llama-2-7b-hf")
|
692 |
# player_one = LocalLoraLlamaPlayer("meta-llama/Llama-2-7b-hf", "/workspace/axolotl/lora2-out")
|
|
|
697 |
# player_one = NanoGptPlayer(model_name=player_one_recording_name, move_num_in_gamestate=move_num_in_gamestate)
|
698 |
#player_one_recording_name = f"xformer_rdm_{rm}"
|
699 |
player_one = MambaPlayer(model_name=player_one_recording_name, move_num_in_gamestate=move_num_in_gamestate)
|
700 |
+
player_one_recording_name = f'contrastive_weights_rdm/mamba_rdm_wgt_{wgt}' #f'contrastive_rdm/mamba_rdm_{rm}'
|
701 |
if not update_activations:
|
702 |
+
player_one.apply_contrastive_activations(path=activations_path, weight=wgt)
|
703 |
|
704 |
#player_two = StockfishPlayer(skill_level=i, play_time=0.1)
|
705 |
player_two = LC0PLayer(skill=i)
|
chess-gpt-eval-contrastive/mamba_module.py
CHANGED
@@ -137,7 +137,12 @@ class MambaPlayer:
|
|
137 |
logits[indices_to_remove] = -float('Inf')
|
138 |
|
139 |
probs = torch.nn.functional.softmax(logits, dim=-1)
|
140 |
-
|
|
|
|
|
|
|
|
|
|
|
141 |
if next_token_id == self.space_tok or next_token_id==self.dot_tok:
|
142 |
if have_non_space:
|
143 |
break
|
|
|
137 |
logits[indices_to_remove] = -float('Inf')
|
138 |
|
139 |
probs = torch.nn.functional.softmax(logits, dim=-1)
|
140 |
+
probs = torch.clamp(probs, min=1e-6, max=1.0)
|
141 |
+
probs = probs / probs.sum()
|
142 |
+
try:
|
143 |
+
next_token_id = torch.multinomial(probs, num_samples=1)
|
144 |
+
except:
|
145 |
+
return None
|
146 |
if next_token_id == self.space_tok or next_token_id==self.dot_tok:
|
147 |
if have_non_space:
|
148 |
break
|
chess-gpt-eval-contrastive/nanogpt/__pycache__/model.cpython-310.pyc
CHANGED
Binary files a/chess-gpt-eval-contrastive/nanogpt/__pycache__/model.cpython-310.pyc and b/chess-gpt-eval-contrastive/nanogpt/__pycache__/model.cpython-310.pyc differ
|
|
chess-gpt-eval-contrastive/nanogpt/__pycache__/nanogpt_module.cpython-310.pyc
CHANGED
Binary files a/chess-gpt-eval-contrastive/nanogpt/__pycache__/nanogpt_module.cpython-310.pyc and b/chess-gpt-eval-contrastive/nanogpt/__pycache__/nanogpt_module.cpython-310.pyc differ
|
|