Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python?code
I just realized - you mentioned that you are using Python to run it - if you use PyPy instead, you should get about 3x speedup or more. That was a great suggestion! With PyPy michi now takes less than one minute per move. Maybe I'll play it some more.. mr. Andrea Carta ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python?code
You'll need to start reading/changing the code - the second point is about the N_SIMS variable. Well, I don't like changing other people's software, but if you wish... What kind of computer are you playing on? It might be that on Windows Python cannot use multiple processes... Windows 7 on a I5 processor, and I'm quite sure multiprocesses is OK (I see 5 python processes running when michi is thinking). Maybe it's multicore usage not working properly. I will investigate that. BTW, this morning I managed to finish the game. I won by 7 points (88-81 area), that means either me or michi won depending on Komi. Let's say this was a practical draw, meaning our level should be the same, and that confirms michi must really be 6K on KGS. I noticed michi got on playing for a long time after the game was settled, despite my continual passing. For a 6K program that was a bit strange. mr. Andrea Carta ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python?code
Windows 7 on a I5 processor, and I'm quite sure multiprocesses is OK (I see 5 python processes running when michi is thinking). Maybe it's multicore usage not working properly. I will investigate that. I just realized - you mentioned that you are using Python to run it - if you use PyPy instead, you should get about 3x speedup or more. Have you tried ShedSkin? It compiles python code to c++ code. http://code.google.com/p/shedskin/ Folkert van Heusden -- www.TrustedTimestamping.com is a service that enables you to show that at a certain point in time, you had access to a hash-value reflecting the contents of a file (this file can be a word document, a jpeg image, everything). -- Phone: +31-6-41278122, PGP-key: 1F28D8AE, www.vanheusden.com ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python?code
On Fri, Mar 27, 2015 at 02:18:05PM +, Andrea Carta wrote: You'll need to start reading/changing the code - the second point is about the N_SIMS variable. Well, I don't like changing other people's software, but if you wish... Well, reading and tweaking the source code is the whole point of Michi. It is not a competitive-strength Go program after all. What kind of computer are you playing on? It might be that on Windows Python cannot use multiple processes... Windows 7 on a I5 processor, and I'm quite sure multiprocesses is OK (I see 5 python processes running when michi is thinking). Maybe it's multicore usage not working properly. I will investigate that. I just realized - you mentioned that you are using Python to run it - if you use PyPy instead, you should get about 3x speedup or more. BTW, this morning I managed to finish the game. I won by 7 points (88-81 area), that means either me or michi won depending on Komi. Let's say this was a practical draw, meaning our level should be the same, and that confirms michi must really be 6K on KGS. Thanks for playing it and reporting! I noticed michi got on playing for a long time after the game was settled, despite my continual passing. For a 6K program that was a bit strange. Yes, early passing is one thing that I didn't implement and would be a nice addition. Petr Baudis ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
very nice job 2015-03-25 16:36 GMT+01:00 Petr Baudis pa...@ucw.cz: Hi! So what's the strongest program you can make with minimum effort and code size while keeping maximum clarity? Chess programers were exploring this for long time, e.g. with Sunfish, and that inspired me to try out something similar in Go over a few evening recently: https://github.com/pasky/michi Unfortunately, Chess rules are perhaps more complicated for humans, but much easier to play for computers! So the code is longer and more complicated than Sunfish, but hopefully it is still possible to understand it for a Computer Go newbie over a few hours. I will welcome any feedback and/or pull requests. Contrary to other minimalistic UCT Go players, I wanted to create a program that actually plays reasonably. It can beat many beginners and on 15x15 fares about even with GNUGo; even on 19x19, it can win about 20% of its games with GNUGo on a beefier machine. Based on my observations, the limiting factor is time - Python is slw and a faster language with the exact same algorithm should be able to speed this up at least 5x, which should mean at least two ranks level-up. I attempt to leave the code also as my legacy, not sure if I'll ever get back to Pachi - these parts of a Computer Go program I consider most essential. The biggest code omission wrt. strength is probably lack of 2-liberty semeai reading and more sophisticated self-atari detection. P.S.: 6k KGS estimate has been based on playtesting against GNUGo over 40-60 games - winrate is about 50% with 4000 playouts/move. Best I can do... But you can connect the program itself to KGS too: http://www.gokgs.com/gameArchives.jsp?user=michibot -- Petr Baudis If you do not work on an important problem, it's unlikely you'll do important work. -- R. Hamming http://www.cs.virginia.edu/~robins/YouAndYourResearch.html ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
On 25/03/2015 16:36, Petr Baudis wrote: So what's the strongest program you can make with minimum effort and code size while keeping maximum clarity? Chess programers were exploring this for long time, e.g. with Sunfish, and that inspired me to try out something similar in Go over a few evening recently: Thank you for the result of your few evenings. This is a great piece of code, interesting to study and to play with. It certainly replaces more than tens of thousands of words for someone that want to be introduced to the computer go field. If I find the time, I will follow what you suggest, trying to keep the right balance between clarity, brevity and efficiency. Many thanks again, ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python?code
It should be enough to just enter the path to the program, make sure to pass the gtp parameter. Try opening the shell window to investigate if you hit trouble. After opening the shell window it works: michi.py is the right command to let it work (of course I have the Python interpreter installed). In GoGui, it does not. Selecting michi.py from new program window throws an invalid win32 application. The same happens selecting michi.pyc (the compiled program, that also works inside the shell window). Selecting python executable plus full path of michi.py throws malformed response. Nothing changes adding --mode gtp to all the commands above. - can't download patterns.spats. Download stops at 247 bytes. Oops, thanks for the heads-up. Fixed. Now it works! Thanks. mr. Andrea Carta ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python?code
The correct parameter is 'gtp', not '--mode gtp'. That worked! It was necessary to insert full path of python executable followed by full path of michi, then gtp. Full path of michi only + gtp throws again the same error (not a win32 application). Other things: - when playing (michi) against GnuGo (that was winning) I inserted a wrong move, then typed help hoping to get help about getting the move back. The program crashed. - at the moment I'm playing myself against michi. It takes more than 3 minutes per move (13x13). Are there severals levels of play to set up? mr. Andrea Carta ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python?code
On Thu, Mar 26, 2015 at 08:59:36PM +, Andrea Carta wrote: Other things: - when playing (michi) against GnuGo (that was winning) I inserted a wrong move, then typed help hoping to get help about getting the move back. The program crashed. - at the moment I'm playing myself against michi. It takes more than 3 minutes per move (13x13). Are there severals levels of play to set up? You'll need to start reading/changing the code ;-) - the second point is about the N_SIMS variable. But really, 3 minutes per move sounds very long. What kind of computer are you playing on? It might be that on Windows Python cannot use multiple processes... - which would be to bad because then the program will just be awfully slow/weak. -- Petr Baudis If you do not work on an important problem, it's unlikely you'll do important work. -- R. Hamming http://www.cs.virginia.edu/~robins/YouAndYourResearch.html ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
[Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
Hi! So what's the strongest program you can make with minimum effort and code size while keeping maximum clarity? Chess programers were exploring this for long time, e.g. with Sunfish, and that inspired me to try out something similar in Go over a few evening recently: https://github.com/pasky/michi Unfortunately, Chess rules are perhaps more complicated for humans, but much easier to play for computers! So the code is longer and more complicated than Sunfish, but hopefully it is still possible to understand it for a Computer Go newbie over a few hours. I will welcome any feedback and/or pull requests. Contrary to other minimalistic UCT Go players, I wanted to create a program that actually plays reasonably. It can beat many beginners and on 15x15 fares about even with GNUGo; even on 19x19, it can win about 20% of its games with GNUGo on a beefier machine. Based on my observations, the limiting factor is time - Python is slw and a faster language with the exact same algorithm should be able to speed this up at least 5x, which should mean at least two ranks level-up. I attempt to leave the code also as my legacy, not sure if I'll ever get back to Pachi - these parts of a Computer Go program I consider most essential. The biggest code omission wrt. strength is probably lack of 2-liberty semeai reading and more sophisticated self-atari detection. P.S.: 6k KGS estimate has been based on playtesting against GNUGo over 40-60 games - winrate is about 50% with 4000 playouts/move. Best I can do... But you can connect the program itself to KGS too: http://www.gokgs.com/gameArchives.jsp?user=michibot -- Petr Baudis If you do not work on an important problem, it's unlikely you'll do important work. -- R. Hamming http://www.cs.virginia.edu/~robins/YouAndYourResearch.html ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
On Wed, Mar 25, 2015 at 4:57 PM, Petr Baudis pa...@ucw.cz wrote: I'm afraid you won't get a good inspiration about properly implementing a board structure. That would make the code a lot more complicated and much longer! And, uh, the program actually does not implement UCT. ;-) It uses RAVE exclusively for exploration (like Pachi). I have just pushed out a branch uct which includes the UCB1 exploration term, it seemed ok in 40 games against GNUGo but I wasn't impressed in its performance on KGS at all (michibot2) and sadly I don't have resources to test it further, so I'm leaving it in a side branch. Still better than the bare MC and AMAF bots I have right now. :) And it certainly can't hurt to look at one more bot for inspiration. Urban -- Blog: http://bettong.net/ Twitter: https://twitter.com/ujh Homepage: http://www.urbanhafner.com/ ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
Awesome, Petr. I haven't programmed in Python for a long time (I like Ruby better), but I think I should be able to understand it without a problem. It seems like a good starting point to see how UCT is implemented (I still haven't gotten around to it for my bot https://github.com/ujh/iomrascalai) and how to properly implement a board structure (it's quite slow at the moment). Urban On Wed, Mar 25, 2015 at 4:36 PM, Petr Baudis pa...@ucw.cz wrote: Hi! So what's the strongest program you can make with minimum effort and code size while keeping maximum clarity? Chess programers were exploring this for long time, e.g. with Sunfish, and that inspired me to try out something similar in Go over a few evening recently: https://github.com/pasky/michi Unfortunately, Chess rules are perhaps more complicated for humans, but much easier to play for computers! So the code is longer and more complicated than Sunfish, but hopefully it is still possible to understand it for a Computer Go newbie over a few hours. I will welcome any feedback and/or pull requests. Contrary to other minimalistic UCT Go players, I wanted to create a program that actually plays reasonably. It can beat many beginners and on 15x15 fares about even with GNUGo; even on 19x19, it can win about 20% of its games with GNUGo on a beefier machine. Based on my observations, the limiting factor is time - Python is slw and a faster language with the exact same algorithm should be able to speed this up at least 5x, which should mean at least two ranks level-up. I attempt to leave the code also as my legacy, not sure if I'll ever get back to Pachi - these parts of a Computer Go program I consider most essential. The biggest code omission wrt. strength is probably lack of 2-liberty semeai reading and more sophisticated self-atari detection. P.S.: 6k KGS estimate has been based on playtesting against GNUGo over 40-60 games - winrate is about 50% with 4000 playouts/move. Best I can do... But you can connect the program itself to KGS too: http://www.gokgs.com/gameArchives.jsp?user=michibot -- Petr Baudis If you do not work on an important problem, it's unlikely you'll do important work. -- R. Hamming http://www.cs.virginia.edu/~robins/YouAndYourResearch.html ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go -- Blog: http://bettong.net/ Twitter: https://twitter.com/ujh Homepage: http://www.urbanhafner.com/ ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
On Wed, Mar 25, 2015 at 04:49:04PM +0100, Urban Hafner wrote: Awesome, Petr. I haven't programmed in Python for a long time (I like Ruby better), but I think I should be able to understand it without a problem. It seems like a good starting point to see how UCT is implemented (I still haven't gotten around to it for my bot https://github.com/ujh/iomrascalai) and how to properly implement a board structure (it's quite slow at the moment). I'm afraid you won't get a good inspiration about properly implementing a board structure. That would make the code a lot more complicated and much longer! And, uh, the program actually does not implement UCT. ;-) It uses RAVE exclusively for exploration (like Pachi). I have just pushed out a branch uct which includes the UCB1 exploration term, it seemed ok in 40 games against GNUGo but I wasn't impressed in its performance on KGS at all (michibot2) and sadly I don't have resources to test it further, so I'm leaving it in a side branch. -- Petr Baudis If you do not work on an important problem, it's unlikely you'll do important work. -- R. Hamming http://www.cs.virginia.edu/~robins/YouAndYourResearch.html ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
So what's the strongest program you can make with minimum effort and code size while keeping maximum clarity? Chess programers were exploring this for long time, e.g. with Sunfish, and that inspired me to try out something similar in Go over a few evening recently: https://github.com/pasky/michi Very nice! I think I will learn from it. Unfortunately, Chess rules are perhaps more complicated for humans, but much easier to play for computers! So the code is longer and more complicated than Sunfish, but hopefully it is still possible to understand it for a Computer Go newbie over a few hours. I will welcome any feedback and/or pull requests. Contrary to other minimalistic UCT Go players, I wanted to create a program that actually plays reasonably. It can beat many beginners and on 15x15 fares about even with GNUGo; even on 19x19, it can win about 20% of its games with GNUGo on a beefier machine. Based on my observations, the limiting factor is time - Python is slw and a faster language with the exact same algorithm should be able to speed this up at least 5x, which should mean at least two ranks level-up. Maybe a first step would be using numpy arrays for the board and patterns. They are quite fast, so the pattern matching should go fast. It won't be any help for the really sequential loops, however. I attempt to leave the code also as my legacy, not sure if I'll ever get back to Pachi - these parts of a Computer Go program I consider most essential. The biggest code omission wrt. strength is probably lack of 2-liberty semeai reading and more sophisticated self-atari detection. It will certainly be an essential learning tool for future newcomers! Jonas ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
Based on my observations, the limiting factor is time - Python is slw and a faster language with the exact same algorithm should be able to speed this up at least 5x, which should mean at least two ranks level-up. Maybe a first step would be using numpy arrays for the board and patterns. They are quite fast, so the pattern matching should go fast. It won't be any help for the really sequential loops, however. On further thought, I think the pattern matching for strings is already fast, so maybe nothing to gain. There is no real operation ON the arrays in the programm… Jonas ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
On Wed, Mar 25, 2015 at 07:14:39PM +0100, Kahn Jonas wrote: Based on my observations, the limiting factor is time - Python is slw and a faster language with the exact same algorithm should be able to speed this up at least 5x, which should mean at least two ranks level-up. Maybe a first step would be using numpy arrays for the board and patterns. They are quite fast, so the pattern matching should go fast. It won't be any help for the really sequential loops, however. On further thought, I think the pattern matching for strings is already fast, so maybe nothing to gain. There is no real operation ON the arrays in the programm… To speed up the Python program, first thing would be to add a list of chains with list of liberties - right now, chains get floodfilled and regexed again and again and it's a huge time sink. Maybe that could speed things up by 25-100%, but I just didn't feel like doing that myself anymore. :-) -- Petr Baudis If you do not work on an important problem, it's unlikely you'll do important work. -- R. Hamming http://www.cs.virginia.edu/~robins/YouAndYourResearch.html ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
Cython works well too. Sage uses cython. ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
Oh wow, 640 lines? And gets 6k? Thats impressive! ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python?code
On Thu, Mar 26, 2015 at 12:11:52AM +, Andrea Carta wrote: Petr Baudis pasky at ucw.cz writes: that inspired me to try out something similar in Go over a few evening recently: https://github.com/pasky/michi Very nice work, dr. Baudis! But: - have you any idea how to get it to work with GoGui under Windows (I guess it was developed under Linux)? It should be enough to just enter the path to the program, make sure to pass the gtp parameter. Try opening the shell window to investigate if you hit trouble. - can't download patterns.spats. Download stops at 247 bytes. Oops, thanks for the heads-up. Fixed. Thanks, -- Petr Baudis If you do not work on an important problem, it's unlikely you'll do important work. -- R. Hamming http://www.cs.virginia.edu/~robins/YouAndYourResearch.html ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go
Re: [Computer-go] [ANN] Michi - 15x15 ~6k KGS in 540 lines of Python code
Petr Baudis pasky at ucw.cz writes: that inspired me to try out something similar in Go over a few evening recently: https://github.com/pasky/michi Very nice work, dr. Baudis! But: - have you any idea how to get it to work with GoGui under Windows (I guess it was developed under Linux)? - can't download patterns.spats. Download stops at 247 bytes. mr. Andrea Carta ___ Computer-go mailing list Computer-go@computer-go.org http://computer-go.org/mailman/listinfo/computer-go