Spaces:
Sleeping
Sleeping
File size: 2,340 Bytes
7fefc87 172a1e4 e7a440c beb9e09 172a1e4 9e90422 7d23b62 d97a106 172a1e4 7d23b62 d97a106 7d23b62 d97a106 172a1e4 d97a106 9e90422 172a1e4 9e90422 172a1e4 d8f258e 6b8ff79 172a1e4 beb9e09 5bb5dc3 ae94556 5bb5dc3 ae94556 |
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 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 |
"""
FileName: const.py
Author: Benhao Huang
Create Date: 2023/11/19
Description: Some const value for Demo
"""
import numpy as np
_AI_AID_INFO = ["Use AI Aid", "Close AI Aid"]
_BOARD_SIZE = 9
_BOARD_SIZE_1D = _BOARD_SIZE * _BOARD_SIZE
_BLANK = 0
_BLACK = 1
_WHITE = 2
_HUMAN = 4
_AI = 5
_NEW = 3
_PLAYER_SYMBOL1 = {
_WHITE: "βͺ",
_BLANK: "β",
_BLACK: "β«",
_NEW: "π΄",
}
_PLAYER_SYMBOL2 = {
_BLACK: "βͺ",
_BLANK: "β",
_WHITE: "β«",
_NEW: "π΄",
}
_PLAYER_NAME = {
_AI: "AI",
_BLANK: "Blank",
_HUMAN: "YOU HUMAN",
}
_PLAYER_COLOR_AI_VS_AI = {
_WHITE: "WHITE",
_BLANK: "Blank",
_BLACK: "BLACK",
}
_PLAYER_COLOR = {
_WHITE: "WHITE",
_BLANK: "Blank",
_BLACK: "BLACK",
}
_HORIZONTAL = np.array(
[
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
[1, 1, 1, 1, 1],
[0, 0, 0, 0, 0],
[0, 0, 0, 0, 0],
]
)
_VERTICAL = np.array(
[
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 1, 0, 0],
]
)
_DIAGONAL_UP_LEFT = np.array(
[
[1, 0, 0, 0, 0],
[0, 1, 0, 0, 0],
[0, 0, 1, 0, 0],
[0, 0, 0, 1, 0],
[0, 0, 0, 0, 1],
]
)
_DIAGONAL_UP_RIGHT = np.array(
[
[0, 0, 0, 0, 1],
[0, 0, 0, 1, 0],
[0, 0, 1, 0, 0],
[0, 1, 0, 0, 0],
[1, 0, 0, 0, 0],
]
)
_ROOM_COLOR = {
True: _BLACK,
False: _WHITE,
}
_MODEL_PATH = {
"AlphaZero": "Gomoku_MCTS/checkpoint/2023-12-14-18-17-07_test_teaching_learning_collect_epochs=1000_size=9_model=normal/best_policy.model",
"duel": "Gomoku_MCTS/checkpoint/2023-12-14-18-16-09_test_teaching_learning_collect_epochs=1000_size=9_model=duel/best_policy.model",
"Gumbel AlphaZero": "Gomoku_MCTS/checkpoint/2023-12-14-21-19-40_selfplay_epochs=1000_size=9_model=gumbel/best_policy.model",
}
# _MODEL_PATH = {
# "AlphaZero": "Gomoku_MCTS/checkpoint/2023-12-14-18-17-07_test_teaching_learning_collect_epochs=1000_size=9_model=normal/best_policy.model",
# "duel": "Gomoku_MCTS/checkpoint/2023-12-14-10-22-12_test_teaching_learning_collect_epochs=1000_size=9_model=duel/best_policy.model",
# "Gumbel AlphaZero": "Gomoku_MCTS/checkpoint/2023-12-14-21-19-40_selfplay_epochs=1000_size=9_model=gumbel/best_policy.model",
# } |