0
$\begingroup$

I am relatively new to Python but I taught myself enough to code a two-player board game that is similar to chess. It has a simple Tkinter UI. Now I am dipping into machine learning, and I want to write another program to play itself in this game repeatedly and "naturally" learn strategies for playing the game.

Can anyone give advice on what I might be able to use for this? Is Tensorflow a good option? Is there a Python library well suited for this that I could adapt and train? I am partially through the buildingai.elementsofai.com course, but I am still very new at ML / AI.

$\endgroup$

2 Answers 2

0
$\begingroup$

If it's a 2-player game it goes a little deeper into RL if you want both sides to be RL algorithms. I recommend reading about game theory and what is a Nash Equilibrium to start. For algorithms hiivemdptoolbox has openai-gym compatibility as well as Q-Learning. You will need to add code to make 2 learners play each other. I would also recommend adding Dyna-Q to the Q-Learner as it will probably speed up the learning.

$\endgroup$
1
  • $\begingroup$ I was thinking the same thing about leveraging learning from both sides. I guess I couldn't have the same learner play both sides and split the data on the go? $\endgroup$
    – Wes Tomer
    Commented Jun 30, 2021 at 16:46
0
$\begingroup$

There are many approaches - the initial one would be a rule based one with some amount of randomness. The ML-AI approach is some variation of reinforcement learning, defining your game as an environment, see for instance openai-gym. ”Some variation” might be Deep Q Learning or A3C.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .