3
$\begingroup$

I made an AI for Reversi, aka Othello (8×8), like Alpha Zero, using this book. This book is written in Japanese. The source code of the AI I implemented can be found in this Github repository. There are comments written in Japanese, but there are also comments written in English. Check the master branch's README file and source code on GitHub for more details.

I finished writing the code and I trained the model on Google Colab with a GPU. I stopped learning around the 3rd training cycle because it is very slow. I tried to rewrite to bitboard, but, it also very slow. So, how can I make my implementation faster or, in general, how can I improve my implementation, given that I have a limited amount or resources (including computing resources and money)?

Here are some ideas.

  • Reduce the number of hidden layers (it can be weak)
  • Rewrite the source code with Cython (it also run on Google Colab).
  • Rewrite the source code in C++, and run on my PC with GPU.
  • Increase the learning rate (it can do over-fitting)
$\endgroup$
  • $\begingroup$ If i have understood the question right, sourcecode was written in Python to implement a bitboard datastructure for playing reversi and the problem is to increase the performance? The simple answer is to switch from Python to Forth which can be executed computational efficient on a Forth CPU and all the performance problems are gone. $\endgroup$ – Manuel Rodriguez Nov 11 '19 at 12:04
  • $\begingroup$ Thank you for answering! I want to improve the speed and accuracy of self-learning than now even just a little bit. Is Forth faster than C++? I'd like to know whether it has a rich library and is suited for machine learning P.S. I added explanations at that github README.md file. $\endgroup$ – TKTK-ST Nov 12 '19 at 12:22
  • $\begingroup$ What do you mean by "bitboard"? Anyway, I think that this question may be off-topic here. Have a look at ai.stackexchange.com/help/on-topic, which tells you which questions are on-topic here. Try asking this question on Data Science SE. $\endgroup$ – nbro Nov 13 '19 at 22:40
  • $\begingroup$ C++ may not be enough. To radically increase speed you may want to use CUDA. However only bitboard in CUDA would be inefficient due to long transfer time RAM<->GPU. Whole MCTS stack in CUDA would be efficient and fast, but that is highly nontrivial project (there were some MCTS implementation in CUDA). Also, there are some tutorials how to run your own c++/cuda code on colab (never tried it) $\endgroup$ – mirror2image Nov 14 '19 at 10:29
  • 1
    $\begingroup$ I'm sorry. I should have asked there. Thank you for pointing out. I posted here. So, Please check and answer if you can. By the way, bitboard expresses reversi board with bits. In this case, I'm using two variables that is hexadecimal of 8 bits. $\endgroup$ – TKTK-ST Nov 14 '19 at 11:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.