Fixed wrongful appending of current player to board rep
This commit is contained in:
parent
2654006222
commit
785ae6a5be
4
board.py
4
board.py
|
@ -42,7 +42,7 @@ class Board:
|
||||||
negatives = [x if x < 0 else 0 for x in board]
|
negatives = [x if x < 0 else 0 for x in board]
|
||||||
board.append(15 - sum(positives))
|
board.append(15 - sum(positives))
|
||||||
board.append(-15 - sum(negatives))
|
board.append(-15 - sum(negatives))
|
||||||
board += ([1, 0] if np.sign(player) > 0 else [1, 0])
|
board += ([1, 0] if np.sign(player) > 0 else [0, 1])
|
||||||
return np.array(board).reshape(1,-1)
|
return np.array(board).reshape(1,-1)
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class Board:
|
||||||
features.append((board[0] if np.sign(player) < 0 else board[25]) / 2.0)
|
features.append((board[0] if np.sign(player) < 0 else board[25]) / 2.0)
|
||||||
# Calculate how many pieces there must be in the home state and divide it by 15
|
# Calculate how many pieces there must be in the home state and divide it by 15
|
||||||
features.append((15 - sum) / 15)
|
features.append((15 - sum) / 15)
|
||||||
features += ([1,0] if np.sign(cur_player) > 0 else [1,0])
|
features += ([1,0] if np.sign(cur_player) > 0 else [0,1])
|
||||||
test = np.array(features).reshape(1,-1)
|
test = np.array(features).reshape(1,-1)
|
||||||
#print("TEST:",test)
|
#print("TEST:",test)
|
||||||
return test
|
return test
|
||||||
|
|
Loading…
Reference in New Issue
Block a user