gnugo-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [gnugo-devel] tuning patch


From: Arend Bayer
Subject: Re: [gnugo-devel] tuning patch
Date: Mon, 14 Apr 2003 17:17:31 -0400 (EDT)


Paul wrote:

> Arend wrote:
> > Maybe I am biased, but IMHO the best solution is to fix the territorial
> > move valuation of M19. This should be possible by pattern tuning in
> > barriers.db.
>
> can you do it? i'm too unsure about how such a pattern should look. i
> would prefer such a solution as well since it wouldn't involve those nasty
> shape values (and hopefully push move valuation below 1.28).
>
> <do it yourself advertising>
> by adding a pattern that solves the problem to barriers.db you can easily
> convince me that territorial tuning rocks and at the same time provide some
> learning material so i can understand how to work with barrier patterns.
> </do it yourself advertising>
>
> ;)

:)
Guess I have to accept that challenge and try and do come up with s.th.

I have to admit that influence tuning is one where our tools are not
as convenient as for other parts in the engine.
So maybe I should write a short description how to spot the problem about
M19 in your game -- you may or may not be familiar with that, but it's
certainly not too popular:

  Running -d0x100000, which you've probably done, you see that M19 gets 2
  points for:
      M19:   - P19 territory change 1.00 (0.00 -> 1.00)
      M19:   - K18 territory change 1.00 (0.00 -> 1.00)
    M19: 2.00 - change in territory

  Both of these are wrong, so let's try to find the cause for this.
  Running -m0x2a8 --debug-influence M19 we find that (comparing
  "(initial black influence, dragons known)" with "(after move)":

  (a) P19 had black influence before the move, but not after the move,
  and that this seems caused by black having a strength source of value
  30 at O19 before, but not after the move.
  This is usually caused by an intrusion pattern for black that matches
  before but not after the move.

  (b) The territory change at K18 cannot possibly be caused by the influence
  values, so it must be a non-territory pattern.

  To find the patterns that caused this, one can either inspect barriers.db
  directly or run
  -m0x2a8 --debug-influence M19 -d1
  (cough, cough, provided you have already applied the part of the patch
  below that fixes the -d1 output;)

  Searching for "intrusion.*O19" to pin point problem (a) we find
  pattern Intrusion7b as the culprit. Similar search leads to NonTerritory11
  for (b).

I am not sure how best to fix NonTerritory11, which is obviously not general
enough, but the patch below addresses (a) by adding an intrusion at O19 in
the situation after White M19 (using the fact that Black N19 threatens
to capture M19).

No regressions run for this yet, but it gets the valuation of M19 down to
1.05.

Arend


Index: engine/influence.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/influence.c,v
retrieving revision 1.77
diff -u -p -r1.77 influence.c
--- engine/influence.c  20 Mar 2003 11:20:01 -0000      1.77
+++ engine/influence.c  14 Apr 2003 21:11:51 -0000
@@ -1007,7 +1007,7 @@ compute_influence(int color, const char
    */
   if ((move == NO_MOVE
        && !(printmoyo & PRINTMOYO_INITIAL_INFLUENCE))
-      || (move != debug_influence))
+      || (move != NO_MOVE && move != debug_influence))
     debug = debug &~ DEBUG_INFLUENCE;

   do_compute_influence(color, safe_stones, strength, q, move, trace_message);
Index: patterns/barriers.db
===================================================================
RCS file: /cvsroot/gnugo/gnugo/patterns/barriers.db,v
retrieving revision 1.51
diff -u -p -r1.51 barriers.db
--- patterns/barriers.db        24 Mar 2003 11:46:19 -0000      1.51
+++ patterns/barriers.db        14 Apr 2003 21:11:51 -0000
@@ -1199,7 +1199,7 @@ ba
 >return (!xplay_attack(b,c));


-Pattern Intrusion8
+Pattern Intrusion8a
 # ab 3.1.22 revised constraint (see territory valuation in 13x13:2)

 X.X
@@ -1211,6 +1211,23 @@ Q!!
 B.X
 ca!
 ?X.
+
+;oplay_attack(a,B) && !attack(B)
+>return (!xplay_attack(a,c));
+
+
+Pattern Intrusion8b
+# ab New (3.3.18)
+
+?X
+Q!
+X!
+
+:8,B,value(30)
+
+?B
+ca
+X!

 ;oplay_attack(a,B) && !attack(B)
 >return (!xplay_attack(a,c));
Index: regression/endgame.tst
===================================================================
RCS file: /cvsroot/gnugo/gnugo/regression/endgame.tst,v
retrieving revision 1.26
diff -u -p -r1.26 endgame.tst
--- regression/endgame.tst      9 Apr 2003 13:15:24 -0000       1.26
+++ regression/endgame.tst      14 Apr 2003 21:11:51 -0000
@@ -167,6 +167,9 @@ loadsgf games/nngs/gnugo-3.3.17-Wiedeman
 820 gg_genmove white
 #? [H4|M10|K19]*

+loadsgf games/paul.sgf 205
+830 restricted_genmove white M19 B13
+#? [B13]


 ############ End of Tests #################
Index: regression/games/paul.sgf
===================================================================
RCS file: regression/games/paul.sgf
diff -N regression/games/paul.sgf
--- /dev/null   1 Jan 1970 00:00:00 -0000
+++ regression/games/paul.sgf   14 Apr 2003 21:11:51 -0000
@@ -0,0 +1,39 @@
+(;GM[1]FF[3]
+RU[Japanese]SZ[19]HA[2]KM[0.5]
+PW[White]
+PB[Black]
+GN[White (W) vs. Black (B)]
+DT[2003-03-31]
+SY[Cgoban 1.9.14]TM[-]AB[pd][dp]
+RE[W+67.5]
+;W[dc];B[pp];W[nc];B[de];W[ee];B[ef];W[ed];B[dg];W[nq];B[lq];W[no];
+B[pn];W[nm];B[iq];W[pl];B[lc];W[qc];B[qd];W[pc];B[od];W[nb];B[me];
+W[cn];B[ph];W[ic];B[cl];W[cq];B[dq];W[cp];B[do];W[cr];B[dn];W[bn];
+B[el];W[ce];B[cf];W[be];B[ke];W[nk];B[dr];W[kn];B[io];W[pr];B[qp];
+W[rq];B[ql];W[qk];B[qm];W[rk];B[rp];W[im];B[rl];W[qq];B[pk];W[pj];
+B[rn];W[ah];B[ni];W[li];B[mj];W[hn];B[lj];W[ki];B[fo];W[kl];B[mh];
+W[gd];B[gl];W[kj];B[lh];W[ds];B[es];W[cs];B[fr];W[ri];B[rg];W[hk];
+B[rc];W[rb];B[jg];W[rd];B[re];W[sc];B[sq];W[sr];B[sp];W[mr];B[lr];
+W[ok];B[ei];W[ne];B[nd];W[kb];B[lb];W[ka];B[kc];W[jc];B[jd];W[gi];
+B[fi];W[bi];B[lk];W[ii];B[rr];W[rh];B[qr];W[pq];B[ss];W[qg];B[rf];
+W[pg];B[og];W[qh];B[gh];W[gj];B[ih];W[ll];B[oc];W[ob];B[oh];W[qf];
+B[qe];W[mi];B[nj];W[bk];B[bl];W[qs];B[pf];W[he];B[fj];W[kh];B[kg];
+W[hl];B[ff];W[gm];B[gk];W[go];B[fm];W[gp];B[hp];W[hi];B[hh];W[gq];
+B[gr];W[ck];B[dk];W[op];B[co];W[bo];B[oo];W[on];B[ak];W[aj];B[al];
+W[po];B[qo];W[cj];B[pm];W[om];B[dj];W[ci];B[bf];W[af];B[dd];W[cd];
+B[df];W[ms];B[kk];W[jk];B[ji];W[jj];B[jh];W[hq];B[kp];W[hr];B[hs];
+W[ir];B[jr];W[is];B[hf];W[ie];B[if];W[fe];B[id];W[hd];B[je];W[fq];
+B[mb];W[fn];B[en];W[gn];B[gs];W[fp];B[sh];W[si];B[sk];W[sj];B[sl];
+W[sg];B[dh];W[mk];B[eo];W[pi];B[gf];W[la];B[mc];W[eq];B[er];W[oo];
+B[ma];W[jb];B[na];W[pb];B[oa];W[cm];B[pa];W[qa];B[dm];W[bg];B[oi];
+W[ch];B[an];W[am];B[bm];W[ap];B[am];W[oj];B[of];W[sf];B[se];W[sh];
+B[sd];W[rc];B[di];W[ao];B[dl];W[ar];B[ge];W[fc];B[cg];W[ep];B[sr];
+W[ps];B[rs];W[tt];B[tt];
+TW[aa][ba][ca][da][ea][fa][ga][ha][ia][ja][ra][sa][ab][bb][cb][db][eb][fb][gb][hb][ib][qb][sb][ac][bc][cc][ec][gc][hc][ad][bd][fd][ae][ag][bh][ai][qi][bj][hj][ij][qj][rj][ik][pk][il][jl][ml][nl][ol][hm][jm][km][lm][mm][in][jn][ln][mn][nn][ho][io][jo][ko][lo][mo][bp][hp][ip][jp][kp][lp][mp][np][aq][bq][iq][jq][kq][lq][mq][oq][br][jr][kr][lr][nr][or][as][bs][js][ks][ls][ns][os]
+TB[kd][ld][md][le][ne][oe][pe][jf][kf][lf][mf][nf][eg][fg][gg][hg][ig][lg][mg][ng][eh][fh][nh][ej][ek][fk][fl][em][rm][sm][qn][sn][ro][so][fs]
+C[The game is over.  Final score:
+   White = 94 territory + 11 captures + 0.5 komi = 105.5
+   Black = 35 territory + 3 captures = 38
+White wins by 67.5.
+]
+)





reply via email to

[Prev in Thread] Current Thread [Next in Thread]