pasky / pachi

A fairly strong Go/Baduk/Weiqi playing program
http://pachi.or.cz/
GNU General Public License v2.0
514 stars 117 forks source link

Selfatari prior code #19

Closed lemonsqueeze closed 8 years ago

lemonsqueeze commented 8 years ago

Hi,

I was seeing strange results while testing the new selfatari code, no matter what I tried it didn't seem to make a difference in playing strength. At first i thought the new code might not be that good after all but then i tried an improved version and still no difference !

I was going to try to use it only in the prior code which surely should be beneficial when i noticed playout_moggy_assess_one() does:

if (!board_playing_ko_threat && is_bad_selfatari)
    add_prior_value(0)

Shouldn't it be something like this ?

if (!board_playing_ko_threat && is_selfatari)
    if (is_bad_selfatari)
        add_prior_value(0)
    else
        add_prior_value(1)

Just tried a few games with this, looks like winrates improve quite a bit.

I was wondering about the selfatari logic in patterns.c also, does this mean there are two selfatari prior inputs ?

lemonsqueeze commented 8 years ago

Does it make sense to refine it some more, say, not encouraging good but trivial selfataris ?

I'm thinking about selfataris which are actually not selfataris because of connection/capture. I guess there's already code to encourage that.

lemonsqueeze commented 8 years ago

Oh wait, this doesn't work actually, just got lucky at first ...

pasky commented 8 years ago

So, does your change have a good effect or not? It may be an interesting idea, but something to benchmark by playtesting. Not sure if your last comment means we should close this?

(In general, if I was working on Pachi now, I'd probably look for ways to apply machine learning to this rather than building even more sophisticated rules - because there's a lot of them and a lot of nuances and some are more important than others in practice.)

lemonsqueeze commented 8 years ago

Yes, looks like machine learning is the future, esp since alphago. Writing rules by hand is something of a nightmare =) I'll close this...