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

Chess implementation? #296

Closed
jamesbraza opened this issue Mar 1, 2023 · 6 comments
Closed

Chess implementation? #296

jamesbraza opened this issue Mar 1, 2023 · 6 comments

Comments

@jamesbraza
Copy link

jamesbraza commented Mar 1, 2023

I am making this issue on 2/28/2023, and at this point in time I don't see a chess implementation.

Are there any plans to implement chess here?

Alternately, are there any known repo(s) that implement chess using this AGZ general framework? Preferably they use the python-chess library to handle chess specifics.


Research

Based on issues in this repo, I have found multiple descendants:

I also discovered this 4/18/2021 PR (currently unaccepted) by @yeekit24: #240

Lastly, here are a few other noteworthy repos, not based on this framework:

@TheMessik
Copy link

Mine is very much WIP and at an early stage. It should be runnable, but the network you get out of it isn't anywhere near good

@jamesbraza
Copy link
Author

@TheMessik where did you get your network architecture from (e.g. use of batch norms, hyperparams of layers, etc)?

@TheMessik
Copy link

I believe I based it on the Othello network, adding and removing layers and changing parameters until it worked. That part was rushed and needs a rewrite

@vedanta28
Copy link

@TheMessik What do you think that it's Elo is? Like I wanted to create something for a variation of chess. Three Check Chess with an additional rule that pawns move diagonally and capture moving forward. Would just changing these rules in your chess.py and training it , work?

@TheMessik
Copy link

It's ELO will definitely be in single digits. I was training it on endgames, so it's opening and middlegame is nonexistent, it's pretty much a random player there.

I don't think python-chess supports 3 checks variant, so you'll also need to do your own game ended checking, aside from adapting the move masking function.

@jamesbraza
Copy link
Author

Hello all, for posterity here is my working chess implementation: https://github.com/jamesbraza/cs234-dreamchess/tree/main/azg_chess

The AI inside nn.py was trainable and shown to improve in skill across rounds of self-play. I found an "unsigned" embedding (read the module for what that means) worked better than a "signed" embedding given the same number of training iterations. Also, the Game subclass is fully unit tested and works well.

For me, this was part of a Stanford CS234 Reinforcement Learning class project that I was rushing to complete in the last weeks, so I didn't have time to do a full-blown multi-day training to see how strong the AI could get (measured in Elo). Hope this can help someone in the future, or serve as a better starting point for a PR into this repo. Cheers!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants