From 40c228ef01350c7e5534a0a8ccf56506e1a55daa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christoffer=20M=C3=BCller=20Madsen?= Date: Tue, 22 May 2018 15:36:23 +0200 Subject: [PATCH] pubeval tests --- test.py | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/test.py b/test.py index 90cea23..0c6d8a6 100644 --- a/test.py +++ b/test.py @@ -737,6 +737,23 @@ class TestBoardFlip(unittest.TestCase): self.assertTrue((Board.board_features_tesauro(board, 1) == np.array(expected).reshape(1, 198)).all()) + def test_pubeval_features(self): + board = Board.initial_state + + expected = (0, + 2, 0, 0, 0, 0, -5, + 0, -3, 0, 0, 0, 5, + -5, 0, 0, 0, 3, 0, + 5, 0, 0, 0, 0, -2, + 0, + 0, 0) + + import numpy as np + self.assertTrue((Board.board_features_to_pubeval(board, 1) == + np.array(expected).reshape(1, 28)).all()) + self.assertTrue((Board.board_features_to_pubeval(board, -1) == + np.array(expected).reshape(1, 28)).all()) + def test_tesauro_bars(self): board = list(Board.initial_state) board[1] = 0