Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backgammon PubEval bot #74

Closed
jamesdfrost opened this issue Sep 25, 2019 · 5 comments
Closed

Backgammon PubEval bot #74

jamesdfrost opened this issue Sep 25, 2019 · 5 comments
Labels
contribution welcome It's a nice feature! But we do not have the time to do it ourselves. Contribution welcomed!

Comments

@jamesdfrost
Copy link
Contributor

Looking for some guidance - keen to implement the backgammon PubEval bot for benchmarking backgammon game performance. The original code is in C++ and would rather implement in this if possible, but all the existing bots are written in Python - is it possible to write a C++ bot, or is there a smarter way of doing this?

I can convert the code to Python if necessary, but just want to know if there are other options first.

@lanctot
Copy link
Collaborator

lanctot commented Sep 25, 2019

Hi @jamesdfrost ! It is perfectly fine to have C++ bots; that's why we have the both API in C++ and the Pyhon one wraps it. It would be far more appropriate to write a C++ bot since it would be wrapping C/C++ anyway, so having it be a C++ bot is the best way forward IMO.

Absolutely no need to convert anything to Python! (And if we ever need to expose it through Python, that will be very easy; we'd just need to add a bot loader that can load the C++ bots and hand them over as a Python PyBot object that internally just runs the C++ functions.. that's simple.)

I think we currently don't have many C++ bots (only uniform?) so it's not clear where to put it, maybe the best place would be a top-level bots/ dir to mirror the python subdir.

@lanctot
Copy link
Collaborator

lanctot commented Sep 25, 2019

BTW two questions:

  1. Do we know that PubEval compiles using modern compilers on its own?
  2. What's the license it uses?

@jamesdfrost
Copy link
Contributor Author

The C++ code is really simple, and should be no problem to compile, its basically an implementation of a hard coded feed forward neural network with pre-configured weights, using the raw board position as inputs with P1 pieces as +ve integers and P2 pieces as negative.

In terms of license, Tesauro published this as "Source code is now publicly available" in 1993, link below, before the time of open source licenses. I'm presuming this is OK to use for this project, but interested in views.

https://bkgm.com/rgb/rgb.cgi?view+610

@jblespiau jblespiau added discussion These are nice ideas, still high level, but without a specific design and removed discussion These are nice ideas, still high level, but without a specific design labels Oct 1, 2019
@lanctot lanctot added the contribution welcome It's a nice feature! But we do not have the time to do it ourselves. Contribution welcomed! label Oct 17, 2019
@jamesdfrost
Copy link
Contributor Author

I'm just starting to look into the implementation of this. PubEval is based on evaluating the strength of a particular state, rather than an action, so what I'm going to need to do is get a full list of all the possible next states following a dice roll, and then pick the state with the highest value.

Is there an easy way of getting a list of next possible states from a game, or is this something I'll need to implement within backgammon.cc? Just looking for the cleanest and most "OpenSpiel" way of doing this.

I've also been playing with the DQN algorithm and backgammon, and not getting great results (episode rewards <0.1 against a random opponent, and in some cases negative) so also keen to implement a search based backup operator with a value net (similar to DQN approach but with state values rather than action values, as per @lanctot suggestion here: #58 (comment)) which would also benefit from this.

@lanctot
Copy link
Collaborator

lanctot commented Nov 12, 2019

Hi @jamesdfrost , closing this one now as it's been open for a while and I want to use the Issues for actual outstanding issues.

@lanctot lanctot closed this as completed Nov 12, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
contribution welcome It's a nice feature! But we do not have the time to do it ourselves. Contribution welcomed!
Projects
None yet
Development

No branches or pull requests

3 participants