gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] connection improvement (?)


From: Paul Pogonyshev
Subject: [gnugo-devel] connection improvement (?)
Date: Mon, 18 Nov 2002 22:25:22 +0200

this patch is supposed to improve connection reading. the main idea
is: discard moves when the distance after playing the move is too
large, not when the _current_ distance is too large.

regression delta is quite good: 7 passes, 2 fails:

./regress.sh . connection.tst
29 unexpected PASS!
69 unexpected PASS!
./regress.sh . nicklas1.tst
1213 unexpected PASS!
./regress.sh . trevorc.tst 
910 unexpected FAIL: Correct 'H13', got 'H12'
./regress.sh . connect.tst 
35 unexpected FAIL: Correct '0', got '1 M14'
70 unexpected PASS!
./regress.sh . strategy4.tst 
200 unexpected PASS!
./regress.sh . owl1.tst 
265 unexpected PASS!
./regress.sh . strategy5.tst 
225 unexpected PASS!

however, this comes at a price in connection nodes:

century2002      91008          119421          +31.2%
connection       72381           82412          +13.9%
neurogo          66996           62789           -6.3%
nngs2           203510          196781           -3.7%

i bet, the total increase in connection nodes on the whole regression
suite is about 10% - 15%.

here is some analyzis of regression delta:
connection:29           properly solved.
connection:69           properly solved.
nicklas1:1213           not sure. F12 is not given cut move reasons
                        anymore (looks true) and is deemed unsafe.
trevorc:910 (fail)      no idea. H12 is now valued 14 instead of 6 and
                        H13 is still 11.
connect:35 (fail)       not a bad one. if you exchange N14 and M15 and
                        ask the current version to disconnect, it fails
                        with M14 as well.
connect:70              accidential. caused by the lowered filter (1.4).
                        maybe it should be returned to 1.5, but i'm just
                        too tired to recalculate all the results.
strategy4:200           no idea. Q8 is now valued less by 6 points.
owl1:265                no idea.
strategy5:225           must be a good one. it now sees that O12 is a cut
                        point.

Paul


Index: readconnect.c
===================================================================
RCS file: /cvsroot/gnugo/gnugo/engine/readconnect.c,v
retrieving revision 1.40
diff -u -p -r1.40 readconnect.c
--- readconnect.c       14 Nov 2002 07:40:53 -0000      1.40
+++ readconnect.c       18 Nov 2002 20:20:59 -0000
@@ -2154,13 +2154,18 @@ find_connection_moves(int str1, int str2
     float deltadist1 = conn1.deltas[pos];
     float dist2 = conn2.distances[pos];
     float deltadist2 = conn2.deltas[pos];
-    float d1;
-    float d2;
-    float distance;
+    float d1 = dist1 - deltadist1;
+    float d2 = dist2 - deltadist2;
+    /* The basic quality of the move is the sum of the distances to
+     * each string minus the two delta values. This distance value
+     * will subsequently be modified to take other factors into
+     * account.
+     */
+    float distance = d1 + d2;
     
-    if (dist1 - deltadist1 + dist2 - deltadist2 > 2.5
-       || dist1 > max_dist1 + 0.2
-       || dist2 > max_dist2 + 0.2)
+    if (distance > 2.5
+       || d1 > gg_max(max_dist1 / 2, max_dist1 - 0.2)
+       || d2 > gg_max(max_dist2 / 2, max_dist2 - 0.2))
       continue;
 
     if (IS_STONE(board[pos]) && find_origin(pos) != pos)
@@ -2170,14 +2175,6 @@ find_connection_moves(int str1, int str2
       gprintf("%oMove %1m, (%f, %f, %f, %f)\n",
              pos, dist1, deltadist1, dist2, deltadist2);
 
-    /* The basic quality of the move is the sum of the distances to
-     * each string minus the two delta values. This distance value
-     * will subsequently be modified to take other factors into
-     * account.
-     */
-    d1 = dist1 - deltadist1;
-    d2 = dist2 - deltadist2;
-    distance = d1 + d2;
     if (verbose > 0)
       gprintf("%o  %f, primary distance\n", distance);
     
@@ -2395,11 +2392,18 @@ find_connection_moves(int str1, int str2
   /* Filter out moves with distance at least 1.5 more than the best
    * move.
    */
-  for (r = 0; r < num_moves; r++)
-    if (distances[r] > distances[0] + 1.5)
-      break;
-  num_moves = r;
+  while (num_moves > 1 && distances[num_moves-1] > distances[0] + 1.4)
+    num_moves--;
 
+  while (num_moves > 2 && distances[num_moves-1] > distances[0] + 1.1)
+    num_moves--;
+   
+  while (num_moves > 5 && distances[num_moves-1] > distances[0] + 0.8)
+    num_moves--;
+    
+  if (num_moves > 7)
+    num_moves = 7;
+    
   return num_moves;
 }
 




reply via email to

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