[Top][All Lists]

[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

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


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)

@@ -1211,6 +1211,23 @@ Q!!
+;oplay_attack(a,B) && !attack(B)
+>return (!xplay_attack(a,c));
+Pattern Intrusion8b
+# ab New (3.3.18)

 ;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 @@
+GN[White (W) vs. Black (B)]
+SY[Cgoban 1.9.14]TM[-]AB[pd][dp]
+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]