Open letho1608 opened 9 months ago
Once you have a trained model, you can use
encoding.py
to encode some board state, give that to the model. Then useencoding.py
again to decode to get the resulting move. It should look somewhat similar to what I did inMCTS_self_play
in MCTS.py.
Actually, I still don't understand your project very well, I just ran the pipeline and saw a model in .tar format. I'm not much of an expert in coding so can you show me the process of using your code and how to use that .tar format model?
So, here is a high level overview of my project.
pipeline.py
: This is the file you run to continuously swap between performing MCTS and training.
MCTS.py
: This file implements the Monte Carlo Tree Search Algorithm. Basically sampling random moves and checking the result of doing such moves.
beta_chess.py
: Contains the full model architecture along with the training functions. This is where the model is built and trained.
arena.py
: This file compares the performance of all the trained models. (If you need a reference, this should be a good start)
encoding.py
: This file can convert a chess board into a format that the model can read and understand.
So, regarding that question of yours on how to use a model.
load_model
in the arena.py
file that does exactly this and you can reference.chess
. On line 99 in arena.py
, you can see how to set up a chess board.UCT_search
from MCTS.py
. This is like asking the model to think about the best move in the current game situation. The model will then suggest what it thinks is the best move.decode_action
from encoding.py
.Hopefully this is clear enough for you, I am making a few assumptions to what you know as a programmer. Let me know if there is something you don't fully grasp or understand. I also want to emphasize looking into arena.py
it likely has similar code to what you're looking for!
Once you have a trained model, you can use
encoding.py
to encode some board state, give that to the model. Then useencoding.py
again to decode to get the resulting move. It should look somewhat similar to what I did inMCTS_self_play
in MCTS.py.