Hello everyone, I’d like to share my work related to KataGo.
I converted one of small early KataGo nets to be compatible with tensorflowjs
and provided a simple GUI to play with the net. I didn’t use all the available network
input features to limit the strength to around 2 dan, I also have a hack to make it play
in strength of GnuGo (around 6 kyu)
Perhaps not giving it all the input features leads to some big tactical blindspots? Not necessarily a bad thing, depends on how easy it is to make it blunder, maybe I just got lucky in my first game
I don’t know much about how the tensorflowjs library works, but when I tried playing in the browser, it appears to run the model with a single CPU core. Is it possible to configure this to take advantage of GPU acceleration, if available?
Thank you for your feedback, guys, I will answer in order of questions:
Lack of implemented input features definitely makes the program weaker but blundering happens more because of the absolute lack of search, this is a pure NN without MCTS search like in actual KataGo or similar engines. Regarding input features let me quickly break down what I’ve implemented :
empty square input, e.g. mark all empty squares
black and white stone squares, literally board position
history moves, helps ‘following plan’ as far as I can see from the playing style change
komi adjustment, e.g. not only white + 6.5 but also black -6.5
KataGo net version I used is quite old, from version 1.3.2 if I’m not mistaken. There were different versions - with more and less blocks, hence different in size and strength, I picked up the one that doesn’t take ages to make a move but also not as shallow as 8 block 8mb one.
Overall number of features implemented above, called bin_input is 22, what I implemented so far takes around 13 inputs, e.g. only 5 or 6 is used by history (I was forced to implement board history in my own go board library to make it work). The rest of features require adding even more sophisticated logic which can already be classified more as part of the engine rather than a simple query GUI, e.g. marking area belonging to each side (score estimator needs to be implemented for that sake) or ladder attack and defence features that require to recursively traverse ladder and mark ladder squares. But the only real weakness where the lack of these features is seen very well is 9 stone handicap games. To give you an idea how BAD Dan level version that gives 9 stones handicap - me, OGS 6 Kyu can easily beat it - it for instance runs from ladder when ladder works and gives away huge ponnukis for nothing. With no handicap games it beats Pachi with 1 sec per move time control which is roughly OGS 1dan, it looses to Pachi full strength due to complete lack of tactical reading. To summarize - I was looking for a sparring partner that would help me reaching Dan level. My current understanding is bigger than practical strength so Dan level opponent with Kyu level reading is something I was trying to make for training purposes and for that sake I think this version perfectly fits. After all I was doing this for myself) Latest KataGo with adjustable human style play is surely much better choice for most people. I just didn’t like katrain Kyu level imitation and wanted to create a small simple cross platform in-browser alternative.
CPU vs GPU
I work on raspberry pi 5 as a desktop computer so GPU is out of question for me. To be honest I don’t know if tensorflow js supports GPUs, I guess it should since browsers make use of webgl and can natively talk to GPUs. So just need to check out the docs and I think there should be a simple solution, something like saying ‘cuda’ instead of ‘cpu’ when loading a model.
Again, thanks a lot for your feedbacks and interest to the project. It may happen that this project would appear as embedded app on Takumigo website in case if Michael approves it. To be honest interaction with Michael was one of initial motivations I head, well, apart from the idea of making a sparring partner for myself of course.