Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-07 Thread Darren Cook
I've been messing around with where to apply heuristics. Candidates include: 1) In the UCT tree, since this is earliest in each playout. 2) In the moves beyond the tree (heavy playouts), since this is where most of the moves happen. Because this part is so speed-critical, ... Remi (using

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-07 Thread Rémi Coulom
Darren Cook wrote: I've been messing around with where to apply heuristics. Candidates include: 1) In the UCT tree, since this is earliest in each playout. 2) In the moves beyond the tree (heavy playouts), since this is where most of the moves happen. Because this part is so speed-critical, ...

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-07 Thread Rémi Coulom
Peter Drake wrote: On Jun 6, 2007, at 2:41 PM, Rémi Coulom wrote: Also, if you have a clever probability distribution, the range of values for each move will be very large. For instance, here are two 3x3 shapes used by Crazy Stone (# to move): O O # # . . # O # Gamma = 143473; . # # .

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-07 Thread Rémi Coulom
Jacques Basaldúa wrote: Rémi, are your values the result of learning in masters games? Yes. I took data from a learning experiment based on very few games. So there may be a little overfitting. Still, the ratio between the strongest and the weakest patterns is always very big. I'll run

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-06 Thread Peter Drake
This sounds a lot like the roulette wheel selection scheme used in genetic algorithms. The idea is that each candidate has a different slice of a roulette wheel, with better candidates getting bigger slices. Peter Drake http://www.lclark.edu/~drake/ On Jun 6, 2007, at 2:07 AM, Jacques

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-06 Thread Rémi Coulom
Álvaro Begué wrote: Actually, John had a better idea to do this. In two words: binary tree. The root represents the whole board, and it contains the sum of the probabilities of all the points (you don't need to force this to be 1, if you use non-normalized probabilities). This node points to

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-06 Thread Jason House
On 6/6/07, Rémi Coulom [EMAIL PROTECTED] wrote: I wonder if other people had thought about this before... Álvaro. Yes, I did it in the beginning. But I found that it is faster to divide by more than two. Currently, I keep the probability of the whole board, each line, and each point. It is

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-06 Thread Graham Thomson
I would be weary of using java.util.Random - it is not that random: http://alife.co.uk/nonrandom/. A drop in Mersenne Twister replacement for java.util.Random is available at http://cs.gmu.edu/~sean/research/. Cheers, Graham. On 05/06/07, Peter Drake [EMAIL PROTECTED] wrote: Oddly, there

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-06 Thread Rémi Coulom
Jason House wrote: On 6/6/07, *Rémi Coulom* [EMAIL PROTECTED] mailto:[EMAIL PROTECTED] wrote: I wonder if other people had thought about this before... Álvaro. Yes, I did it in the beginning. But I found that it is faster to divide by more than two. Currently, I

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-06 Thread Peter Drake
Thanks for the tip. It does seem a bit faster (5% speedup of the program overall), and I'm willing to accept the consensus that the randomness is better. Peter Drake http://www.lclark.edu/~drake/ On Jun 6, 2007, at 2:15 PM, Graham Thomson wrote: I would be weary of using java.util.Random

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-06 Thread Peter Drake
On Jun 6, 2007, at 2:41 PM, Rémi Coulom wrote: Also, if you have a clever probability distribution, the range of values for each move will be very large. For instance, here are two 3x3 shapes used by Crazy Stone (# to move): O O # # . . # O # Gamma = 143473; . # # . . . . . . Gamma

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-05 Thread Don Dailey
On Tue, 2007-06-05 at 10:23 -0700, Peter Drake wrote: While there is a bias in theory, I suspect that you are right that it is not significant in practice if you maintain a list of vacant points (as Orego now does), because almost all vacant points are legal. In any case, switching to your

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-05 Thread Jason House
On 6/5/07, Peter Drake [EMAIL PROTECTED] wrote: On a multithreaded program like Orego (running on a multicore machine), it moves the nontrivial random number generation out of the synchronized part of the program and into the threads. I'm surprised to hear this. Do you have a single random

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-05 Thread Don Dailey
But if you are taking the vacant points out it is probably not too biased as you say. But what I do is pretty fast. Always choose a random point but keep shrinking the list. When a point is occupied move it out of the way so it's never selected again. You have to do some simple bookeeping -

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-05 Thread Peter Drake
Oddly, there doesn't seem to be much effect on speed whether I use a single random number generator (i.e., instance of java.util.Random) or one for each thread. Peter Drake http://www.lclark.edu/~drake/ On Jun 5, 2007, at 11:59 AM, Jason House wrote: On 6/5/07, Peter Drake [EMAIL

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-05 Thread Don Dailey
On Tue, 2007-06-05 at 12:28 -0700, Peter Drake wrote: Don't maintain the list of legal moves -- maintain the list of vacant points (almost all of which are legal). When it's time to pick a move, pick a random point in the list and iterate through checking each move for legality. As soon as you

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-05 Thread Don Dailey
On Tue, 2007-06-05 at 15:58 -0400, Don Dailey wrote: You might improve the bias by shuffling on the fly, perhaps when you find a legal move in the un-occupied point section of the list you could do a swap with the first move and a random move. I'm wondering if the biased ordering of the

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-05 Thread Don Dailey
On Tue, 2007-06-05 at 13:12 -0700, Peter Drake wrote: So I'm only temporarily maintaining a list of illegal but unoccupied points - this list gets discarded as soon as a legal move is tried. Does that mean you have to regenerate the list every move? I keep the list of un-occupied points -

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-05 Thread Peter Drake
On Jun 5, 2007, at 12:58 PM, Don Dailey wrote: On Tue, 2007-06-05 at 12:28 -0700, Peter Drake wrote: Don't maintain the list of legal moves -- maintain the list of vacant points (almost all of which are legal). When it's time to pick a move, pick a random point in the list and iterate

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-06-05 Thread Martin Møller Skarbiniks Pedersen
-ansi -Wall -pedantic Why not add -Werror so gcc rejects to compile code with warnings ? Regards Martin ___ computer-go mailing list computer-go@computer-go.org http://www.computer-go.org/mailman/listinfo/computer-go/

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-31 Thread Stuart A. Yeates
When writing C/C++ for multi-platform student assignments using gcc, we always used the args: -ansi -Wall -pedantic Literally use the ANSI standard turn all warnings on and be pedantic about warnings. This, of course, won't help with libraries not being found. cheers stuart

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-31 Thread Sylvain Gelly
Hello, When writing C/C++ for multi-platform student assignments using gcc, we always used the args: -ansi -Wall -pedantic Maybe it depends on the gcc versions, but I always use -Wall -W rather than only -Wall. -W turns on (important) warnings which are not turned on with only -Wall, and as

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-31 Thread Jacques Basaldúa
Hola, Álvaro: Álvaro Begué wrote: Could not compile libego is not a very helpful error message. What exactly did the compiler complain about? My guess is that you don't have the required boost libraries installed. Yes. It must be that. I didn't know about boost libraries. Where can I find

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-30 Thread Jacques Basaldúa
Lukasz Lew wrote: Is libego too complicated? Do You have problems with compilation? Or You are not comfortable with the GNU license? Any other reason? I only wanted to compare performance ( and see what good ideas you had ;-) ) but could not compile libego. Neither with Microsoft Visual

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-30 Thread Álvaro Begué
On 5/30/07, Jacques Basaldúa [EMAIL PROTECTED] wrote: Lukasz Lew wrote: Is libego too complicated? Do You have problems with compilation? Or You are not comfortable with the GNU license? Any other reason? I only wanted to compare performance ( and see what good ideas you had ;-) ) but

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-30 Thread Berk Ozbozkurt
Álvaro Begué wrote: At least for Windows programmers, providing a solution that compiles with major IDEs would help. I assume what you do is standard in Linux, but the things the compiler did not understand neither did I, and I could not find the time for googleing. With 1.08 version of lego

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-30 Thread Álvaro Begué
On 5/30/07, Berk Ozbozkurt [EMAIL PROTECTED] wrote: Álvaro Begué wrote: At least for Windows programmers, providing a solution that compiles with major IDEs would help. I assume what you do is standard in Linux, but the things the compiler did not understand neither did I, and I could not

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-29 Thread Christoph Birk
On Sun, 27 May 2007, ?ukasz Lew wrote: Jason, can You tell me why You don't want to use libego instead? Actually this is open question to all comp-go readers. Is libego too complicated? Do You have problems with compilation? Or You are not comfortable with the GNU license? Any other reason? I

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-28 Thread Don Dailey
But I remember thinking that it might still be useful for evaluation. I remember thinking that that if you compared pseudo liberties to real liberties it might tell you something. If the ratio was high (a lot more pseudo liberties) it might indicate that the liberties are easy to protect. But

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Łukasz Lew
Hi, I've tested many approaches, and the one I implemented is clearly the best. The bias that Peter Drake talks about is negligible and doesn't have a noticeable impact on playout results. (and uniformity of playout isn't something to fight for in MC Go) Jason, can You tell me why You don't

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread steve uurtamo
i'd need to write a C interface for it, then try to maintain compatibility through new releases. (AKA i'd effectively end up rewriting it). it might seem like less of a burden for me to just write my code in C++, but i guess i'm just a caveman who is stuck in his old ways and would rather

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Peter Drake
Yeah, I suffer from this, too. (There's also the fact that using someone else's code would disqualify you from the formal division of the KGS tournaments.) Here's a heroic tale of not-invented-here syndrome for your amusement: http://worsethanfailure.com/Articles/slammerSCR.aspx Peter

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Don Dailey
Here is what I do, don't know if it's best Basically you want a list of empty points, since most of them are legal. When I apply a move to the board I then do any needed legality testing. At the beginning I start with a list of ALL points on the board. When a non-empty point is

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Don Dailey
I'm a language caveman too then. I really avoid C++ even though I learned the basics long ago. I really hate it. It's not like I'm an old dog that can't learn new tricks - I have experimented and explored many computer languages and I am versatile in many. It's one of those languages

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread dhillismail
On Sun, 2007-05-27 at 13:21 -0400, Jason House wrote: As I get into the home stretch of rewriting the core of my bot, I want to add a monte carlo player. I've realized that picking a random move to play is non-trivial since it's such a key element in playout speed. An array of

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Jason House
?ukasz Lew wrote: Jason, can You tell me why You don't want to use libego instead? Actually this is open question to all comp-go readers. Is libego too complicated? Do You have problems with compilation? Or You are not comfortable with the GNU license? Any other reason? I probably have a lot

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Peter Drake
I struggled with unto a lot, too. In the current version of Orego, there is no undo, just a way to copy a board relatively quickly. This falls under keep the common case fast again: you only undo once per playout, so it's faster to make a copy. (For the real board, where actual games moves

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Jason House
Darren Cook wrote: Jason House also mentioned hard coding to a set board size, I think libego can be used at least up to 19x19, just by changing the board_size setting in board.cpp (it also supports hexagonal boards). Or did you mean being able to make one binary for all board sizes? I feel that

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Don Dailey
On Sun, 2007-05-27 at 19:31 -0400, [EMAIL PROTECTED] wrote: If I had it to do over again, knowing what I know now, I would not spend a lot of time optimizing random games. These optimizations don't make much difference for heavy playouts and heavy playouts are better. - Dave Hillis

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Don Dailey
I remember that conversation and the negative response. But to be fair to the ones who were negative, you presented this as an evaluation feature that could be calculated quickly, not as a pure performance optimization. The negative response was in response to the suggestion that it might be

Re: [computer-go] Efficiently selecting a point to play in a random playout

2007-05-27 Thread Jason House
Don Dailey wrote: I remember that conversation and the negative response. But to be fair to the ones who were negative, you presented this as an evaluation feature that could be calculated quickly, not as a pure performance optimization. The negative response was in response to the