Training a simple chess agent (failed miserably) #2400
Unanswered
denizetkar
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Greetings dear community members!
I would like to share with you my efforts and resulting failures at training a chess agent using TorchRL and ask you for guidance.
A few weeks back I had the idea of training a chess AI using PPO with self learning. In the past I had already made extensive use of Pytorch as a deep learning library. When I discovered PytorchRL, I was excited to try it out even though it is clearly not stable yet (I hope it will become stable eventually). So, I gave it a go.
After a week into much coding and debugging, I realized why it isn't a mature library yet because I had to create many of my own subclasses for utilities. But here is more or less what came out of it:
In the days following that, I started running many experiments and tried to reach an AI that can at least consistently win against a randomly acting agent. I tried:
But nothing seemed to work. The actors I trained were consistently performing poorly, and by poor I mean:
Here is some information on how the actions are decided at each step by my agent:
action_0
)False
forblack
andTrue
forwhite
action_net_0
is an MLPaction_0
-> action_net_1 -> Where to move the selected piece (action_1
)The actions are always drawn from the next legal moves given by the chess engine.
Running my training loop is super simple. After installing the dependencies, all it takes is
pipenv run python ./src/train.py
Currently, I feel quite stuck and don't know what to do next to get it working as I wish. So, now I would like to ask you RL experts, what changes would I need to train my agent so that it can at least consistently win against a random actor?
Beta Was this translation helpful? Give feedback.
All reactions