gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] influence modification


From: Gunnar Farneback
Subject: [gnugo-devel] influence modification
Date: Wed, 03 Apr 2002 18:46:15 +0200
User-agent: EMH/1.14.1 SEMI/1.14.3 (Ushinoya) FLIM/1.14.2 (Yagi-Nishiguchi) APEL/10.3 Emacs/20.7 (sparc-sun-solaris2.7) (with unibyte mode)

Consider the end of the game regression/games/filllib10.sgf (newly
added to CVS).

   A B C D E F G H J K L M N O P Q R S T
19 . O . O O X X . . . X X X O O O O . O 19
18 O . O O X X . X X . X X O O O X X O . 18
17 X O . O O X . X O X . . X O O X X O X 17
16 X O O X X X X O O X X X X O O O X X . 16
15 X X X X O O O O X . X O O . O X X X X 15
14 X X X O O X . O X X X O . X X O X X X 14
13 O X O X O . O X O O X O O O O O X O X 13
12 O O O . . O O X X O O X O O O O O O O 12
11 O X O . . . . O X X . X X O X O O O O 11     WHITE has captured 15 stones
10 X X O + . . . O O X . X X X X X X O O 10     BLACK has captured 16 stones
 9 X O O . . . . . O X . X O O . O X X X 9
 8 X X O O . . O O X X X . X O O O O X . 8
 7 . X X O O . O X X X O X X . . . O X . 7
 6 . . X X X O . O O O O O X X . X X O . 6
 5 . X X O O . O X X O X X X . . X . X . 5
 4 X . X O . . . X O O X . O O O + X . . 4
 3 X X O . O O O X O X . X X O O X . . . 3
 2 X O O . . . . O O X . X . O X . X . . 2
 1 X O . O O O O . O X . . . O O X . . . 1
   A B C D E F G H J K L M N O P Q R S T

Everything is finished, but if asked to make a move for black, GNU Go
comes up with Q2, losing a point. If run with appropriate debug flags,
the main reason for making the move is this territorial evaluation:

  Q2:   - P3 territory change 0.38 (1.50 -> 1.88)
  Q2:   - O2 territory change 0.38 (1.50 -> 1.88)
  Q2:   - Q2 territory change -0.50 (0.50 -> -0.00)
  Q2:   - P1 territory change 0.38 (1.50 -> 1.88)
  Q2: 0.62 - change in territory

Clearly something is bad here; correct would be -1.0 in territory
change. My investigations indicate that the problem is that the
inessential stone at P2 is assigned influence strength 0, which later
is assumed to mean that it must be a prisoner for white and thus white
territory. Furthermore this messes up Arend's scheme for degradation
and interpolation of territory values, making it look like black Q2
gains territory.

The patch below solves the problem. Arend, can you review it to see
whether it looks correct with respect to the code you have added to
influence.c?

I'll leave it out of CVS for now, awaiting Arend's comments and/or
regression results.

(Also the CVS machine has stopped responding, so the patch below is
somewhat home-made.)

/Gunnar

--- ../gnugo2/gnugo/engine/influence.c  Wed Apr  3 17:26:08 2002
+++ engine/influence.c  Wed Apr  3 17:23:42 2002
@@ -337,13 +337,17 @@
  *
  * The name saved_stones is historic and should probably be changed
  * since it also includes captured stones.
+ *
+ * The relative strength for inessential stones must be somewhat
+ * larger than 0. Otherwise they may be considered as territory for
+ * the opponent and the territory evaluations may mess up.
  */
 
 static float strength_map[10] = {
   0.0,   /* DEAD            */
   0.9,   /* ALIVE           */
   0.5,   /* CRITICAL        */
-  0.0,   /* INESSENTIAL     */
+  0.01,  /* INESSENTIAL     */
   0.0,   /* TACTICALLY DEAD */
   0.7,   /* WEAK            */
   0.8,   /* WEAKLY_ALIVE    */
@@ -429,6 +433,21 @@
          else
            q->white_permeability[i][j] = 0.0;
        }
+
+       /* We need to make an exception to the rules above for
+         * INESSENTIAL stones. Instead of making the conditions above
+         * still more complex we correct it here.
+        *
+        * If q->p[i][j] is allowed to be 0, the territory evaluation
+        * will think it's a prisoner for the opponent, and various
+        * territory corrections and interpolations will mess up.
+        */
+       if (IS_STONE(board[pos])
+           && dragons_known
+           && dragon[pos].id != -1
+           && DRAGON2(pos).safety == INESSENTIAL
+           && q->p[i][j] == EMPTY)
+         q->p[i][j] = board[pos];
       }
       
       /* When evaluating influence after a move, the newly placed
--- ../gnugo2/gnugo/regression/filllib.tst      Sun Jan 20 19:21:03 2002
+++ regression/filllib.tst      Wed Apr  3 17:54:14 2002
@@ -108,3 +108,9 @@
 #? [S16|T17|O18|Q19]
 32 gg_genmove black
 #? [O18|O19|N18|P19|N19]
+
+loadsgf games/filllib10.sgf
+33 gg_genmove white
+#? [PASS]
+34 gg_genmove black
+#? [PASS]*



reply via email to

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