To answer the title of the thread (“Which programming language should I use for developing an AI that plays Go?”) succinctly, given that you currently have “zero skills in programming”, I highly recommend:
- Start with learning Python.
- At some point later (or possibly in parallel with learning Python), learn some C++.
But, now to say a few more words…
Python is the essential language for studying and applying machine learning these days. It has the best support for libraries and tools, and crucially, so much open-source AI work is done in Python. Thus, it is essential for learning from public code examples.
C++ is also very useful, since it is often the language of choice for applications (like Go AI) with demanding computational performance requirements. The strong, open-source Go AIs mainly use C++, with only some parts in Python.
Of course, in addition to learning how to program, one needs to learn how to use a machine learning library. For starting from scratch and just general usefulness for applying deep learning, I highly recommend PyTorch, since it has become the dominant deep learning platform. There are various tutorials online (such as the official ones here) as well as various YouTube videos and public code examples on GitHub.
Another useful platform is TensorFlow, which was dominant a few years ago, before PyTorch took over. While it is no longer the most popular choice for new projects, I mention it since the LeelaZero AI uses this platform, and there are lots of other older ML projects using it. However, I would prioritize learning PyTorch instead of TensorFlow.
Building a superhuman (or at least very strong) Go AI from scratch really entails two steps:
- Implementing the software to train and execute the Go AI (this is where you learn to program and write the code).
- Training the Go engine (this is where the program from step 1 teaches itself to play Go).
Step 1 is feasible for a self-taught individual working alone. There are a lot of resources to learn how to program and implement Go AI. The fundamental algorithms and concepts behind the modern superhuman AI are not too complicated, and the whole idea is to avoid having to manually program in Go knowledge, but the tricky part lies in implementing things to operate efficiently and at the requisite computational scale.
Step 2 is where things become difficult, not from the conceptual perspective, but purely from the computational angle. Training a superhuman Go AI from scratch simply takes an enormous amount of computational resources. Previous successful efforts required either corporate funding to provide the necessary compute power or leveraged large-scale, distributed computation provided by a community (e.g., Leela Zero).
Other learning resources
For learning about the fundamentals of deep learning and reinforcement learning, both key concepts behind modern superhuman Go AI, here are two free e-books that I highly recommend:
- Goodfellow, Bengio, and Courville’s Deep Learning book
- Sutton & Barto Book: Reinforcement Learning: An Introduction (even briefly discusses AlphaGo and AlphaGo Zero)
Another book that specifically teaches how to program Go AI was recommended by @okonomichiyaki above, but I can’t say much about that one, since I have only skimmed a small part of it in the preview. It seems that it might be helpful.
It is also possible to learn a lot from other open-source Go AI software:
- KataGo: state of the art among the superhuman and open-source Go engines, with a lot of cool features and fundamental advances in improving training efficiency.
- Leela Zero: the first open-source Go AI to achieve superhuman performance with a distributed computation effort from the Go community.
- Pachi: reasonably strong (amateur dan level) Go AI project that began in the pre-AlphaGo era, originally using just Monte Carlo Tree Search (MCTS), but now incorporates deep learning enhancements.
- Michi: a relatively weak bot that does not incorporate any deep learning, but I’m noting it here, since it is a minimalist implementation employing MCTS and entirely written in Python. Looking at this code would be a good learning experience to get some familiarity with Python and the basics of how a Go engine works.
Responses to other people
I think this is definitely true, since there is a significant distinction between using modern machine learning techniques as a tool versus becoming a good programmer. A lot of the work is taken care of by various libraries and tools, and for implementing a lot of basic things, it is often possible to start with some existing example code, mostly follow their pattern, and just modify parts to apply to the specific data and task at hand. Of course, being good at programming does help immensely with accomplishing this, but one does not need to do too much from scratch.
First, it is always great to have such ambitions that motivates one to learn. When someone expresses such an ambition, we should not put them down with such overly discouraging and pessimistic analogies.
Second, it is entirely feasible for one to learn how to program and actually implement something like AlphaGo. The software is not conceptually too difficult. The only really challenging part is finding the computational resources to train it up to superhuman levels starting from scratch.
To be honest, when I first learned this about Python a long time ago, I thought of it as a negative feature as well. However, later on, as I started to use Python more and more, I eventually came to view it as a very positive feature. Using whitespace to delineate blocks removes the need to mess with the clutter of brackets, but what I like most about it, is that it forces one to be organized and tidy with whitespace, and the nesting of your blocks matches their visual formatting, rather than the placement (or potential misplacement) of brackets.
I’m not entirely sure what you mean by this. I actually think that Python has some of the best built-in looping and array semantics, since it natively provides the iterator design pattern. The syntax might seem a bit unfamiliar to those coming from experience with traditional C-style for loops, but I much prefer the Pythonic way of doing things to the traditional styles of looping from other languages. For example,
Python
for item in list_of_things:
apply_operation(item)
for _ in range(number_of_iterations):
do_something()
C-like
for(int i = 0; i < length_of_list; i++) {
apply_operation(list_of_things[i])
}
for(int i = 0; i < number_of_iterations; i++) {
do_something()
}