Added another board_rep
This commit is contained in:
parent
785ae6a5be
commit
95b12a6c35
6
board.py
6
board.py
|
@ -35,6 +35,12 @@ class Board:
|
||||||
board.append(-15 - sum(negatives))
|
board.append(-15 - sum(negatives))
|
||||||
return tuple(board)
|
return tuple(board)
|
||||||
|
|
||||||
|
@staticmethod
|
||||||
|
def board_features_to_slimmed_down_own(board, player):
|
||||||
|
board = list(board)
|
||||||
|
board += ([1, 0] if np.sign(player) > 0 else [0, 1])
|
||||||
|
return np.array(board).reshape(1, -1)
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def board_features_to_own(board, player):
|
def board_features_to_own(board, player):
|
||||||
board = list(board)
|
board = list(board)
|
||||||
|
|
|
@ -15,6 +15,9 @@ class Network:
|
||||||
output_size = 1
|
output_size = 1
|
||||||
# Can't remember the best learning_rate, look this up
|
# Can't remember the best learning_rate, look this up
|
||||||
learning_rate = 0.01
|
learning_rate = 0.01
|
||||||
|
# board_features_to_own has size 30
|
||||||
|
# board_features_to_tesauro has size 198
|
||||||
|
# board_features_to_slimmed_down_own has size 28
|
||||||
board_rep = Board.board_features_to_own
|
board_rep = Board.board_features_to_own
|
||||||
|
|
||||||
def custom_tanh(self, x, name=None):
|
def custom_tanh(self, x, name=None):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user