gnugo-devel
[Top][All Lists]
Advanced

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

[gnugo-devel] Thickness ideas


From: Stéphane Nicolet
Subject: [gnugo-devel] Thickness ideas
Date: Wed, 13 Aug 2003 12:10:04 +0200



On Jul 5, Arend wrote :

Btw, if you want to do more experiments with the influence code, one
thing I never got around to is the following:
you probably know the code that reduces the permeability around stones
(I think by a factor of 0.25 on direct neighbours and 0.5 on diagonal
neighbours). I think this should depend on the number of liberties a
stone has. A single stone with only 3 liberties cannot act freely in
response to a hane, similarly a two stone group with only four liberties
(hane at the head of two stones), etc.


Here is a first try to convince the influence code (in influence.c)
to generate more thickness :


-- Change A implements Arend's idea by turning off the permeability
  reduction around weak stones. I have also lowered the reduction
  on diagonal neighbours of strong stones to 20% (instead of 35%
  previously) because I had noticed that when creating moyos
  GNU Go often played a dubious diagonal 2-2 jump in the following
  situations :

  ..............
  ..............
  ...........XX.
  .......X.X....    Black A would be better one point above (at B)
  .....B..O.....    if Black wants to build a moyo at the top.
  .....A.O.O....
  ..............




- Change B further lowers the influence strength radiating from
  stones which are under attack (short of liberty or surrounded,
  in the sense that they don't have lots of second order liberties).
  This is intented to have the influence code help isolated stones
  or worms by adding a stone to the group to get the full influence
  of the worm back.


My feeling is that change (A) is quite safe, while change (B) has
a more drastic effect on the style of play, but need further tuning
to get a proper effect.


I don't post the modifications as a patch because I have not tested
them intensively, and I won't be able to test them further because
I'm leaving on vacations for 3 weeks. For instance, I just don't have
the time, before my train, to run the regression for change (A) and
(B) independantly.


At the moment, regression results for changes (A)+(B) are 42 PASS
and 39 FAILs, but that's not the point, of course, because I see
that as a work in progress. I thought, however, that this may be
of interest for  the list, so feel free to use/test/modify as you
will :-)


See you,
Stephane


****************************************************************
****************************************************************

Change (A), in find_influence_patterns() :


[...]

    if (ON_BOARD(ii + d) && !q->safe[ii + d]) {
          float reduction = 1.0;
        
          if (use_thickness_ideas) {
            int libs = countlib(ii);
            int size = countstones(ii);
        
            /* Reduce the permeability around living stones, but only
             * around stones which are free to move. The following test
             * modelizes the fact that single stones with only 3 liberties
             * cannot react freely to hane, and similary 2 stones groups
             * (hane at the head of two stones), etc. We also reduce less
             * diagonally (20% instead of 75 %) */
        
            if ((size == 1 && libs >= 4)
                || (size == 2 && libs >= 5)
                || (size == 3 && libs >= 6)
                || (libs - size >= 3))
              reduction = (k < 4) ? 0.25 : 0.80;
          }
          else {
            /* Reduce less diagonally.*/
            reduction = (k < 4) ? 0.25 : 0.65;
          }
        
          if (board[ii] == BLACK)
            q->white_permeability[ii + d] *= reduction;
          else
            q->black_permeability[ii + d] *= reduction;
   }

[...]



***************************************************************
***************************************************************

Change (B), in init_influence() :


[...]

      float source_strength;
          if (strength)
            source_strength = strength[ii];
          else
            source_strength = DEFAULT_STRENGTH;
        
          if (use_thickness_ideas) {
        
            int libs  = worm[ii].liberties;
            int libs2 = worm[ii].liberties2;
            int size  = worm[ii].size;
        
        /* Reduce the influence radiating from surrounded
         * and semi-surrounded worms.
         * FIXME : the reduction factors in the following
         *         lines have quite a dramatic effect on
         *         the playing style. Experiment with softer
         *         values or with better ways to detect
         *         surrounded groups.
         */

            if (libs < size+2 || libs2 < size+4)
              source_strength *= 0.4;
            else if (libs <= size+2 || libs2 <= size+4)
              source_strength *= 0.5;
            else if (libs <= size+2 || libs2 <= size+5)
              source_strength *= 0.9;   
          }
        
          if (board[ii] == WHITE) {
            q->white_strength[ii] = source_strength;
            q->black_permeability[ii] = 0.0;
          }
          else {
            q->black_strength[ii] = source_strength;
            q->white_permeability[ii] = 0.0;
          }

[...]

************************************************************************ * ************************************************************************ *




























... /// ... \\\ ...





reply via email to

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