Skip to content

Commit

Permalink
Improve the compatibility between the C++ and the Python CFR implemen…
Browse files Browse the repository at this point in the history
…tations.

- Bind C++ Policy GetStatePolicyAsMap method to Python.
- Add a function to convert a C++ Policy to a Python policy.
- Rename "policy" to "current_policy" to make both the C++ CFR and the Python CFR APIs equivalent.
- Refactor the Python CFR code to look like more the C++ one, and also have fewer duplicated code.

PiperOrigin-RevId: 271522485
Change-Id: Ibbe614d8e3b73033702eca0bf74b90dc998a7903
  • Loading branch information
DeepMind Technologies Ltd authored and open_spiel@google.com committed Sep 30, 2019
1 parent 71d7663 commit 362f057
Show file tree
Hide file tree
Showing 6 changed files with 214 additions and 259 deletions.
5 changes: 4 additions & 1 deletion open_spiel/algorithms/cfr_br.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,10 @@ namespace open_spiel {
namespace algorithms {

CFRBRSolver::CFRBRSolver(const Game& game)
: CFRSolverBase(game, false, false, false),
: CFRSolverBase(game,
/*alternating_updates=*/false,
/*linear_averaging=*/false,
/*regret_matching_plus=*/false),
policy_overrides_(game.NumPlayers(), nullptr),
uniform_policy_(GetUniformPolicy(game)) {
for (int p = 0; p < game_.NumPlayers(); ++p) {
Expand Down
Loading

0 comments on commit 362f057

Please sign in to comment.