Skip to content

Commit

Permalink
Merge pull request #931 from deepmind:lanctot-patch-41
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 473574950
Change-Id: I2105c3474efa4feb37b4c8ea9695d347016d3ae2
  • Loading branch information
lanctot committed Sep 11, 2022
2 parents fec7620 + 40450a5 commit b7ad42f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions open_spiel/python/algorithms/regret_matching_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ def test_rps(self):
iterations=50000,
gamma=1e-6)
self.assertLen(strategies, 2, "Wrong strategy length.")
# places=1 corresponds to an absolute difference of < 0.001
self.assertAlmostEqual(strategies[0][0], 1 / 3., places=2)
self.assertAlmostEqual(strategies[0][1], 1 / 3., places=2)
self.assertAlmostEqual(strategies[0][2], 1 / 3., places=2)
Expand All @@ -75,9 +76,10 @@ def test_biased_rps(self):
strategies = regret_matching.regret_matching(
[payoffs_array[0], payoffs_array[1]], iterations=50000, gamma=1e-8)
self.assertLen(strategies, 2, "Wrong strategy length.")
self.assertAlmostEqual(strategies[0][0], 1 / 16., places=2)
self.assertAlmostEqual(strategies[0][1], 10 / 16., places=2)
self.assertAlmostEqual(strategies[0][2], 5 / 16., places=2)
# places=1 corresponds to an absolute difference of < 0.01
self.assertAlmostEqual(strategies[0][0], 1 / 16., places=1)
self.assertAlmostEqual(strategies[0][1], 10 / 16., places=1)
self.assertAlmostEqual(strategies[0][2], 5 / 16., places=1)


if __name__ == "__main__":
Expand Down

0 comments on commit b7ad42f

Please sign in to comment.