gnugo-devel
[Top][All Lists]
Advanced

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

Re: [gnugo-devel] How to update GnuGo makefiles ?


From: Gunnar Farneback
Subject: Re: [gnugo-devel] How to update GnuGo makefiles ?
Date: Sat, 21 Jun 2003 23:46:36 +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)

Stephane wrote:
> I am trying to write a module for gnugo that would allow to
> make "parameters fitting" experiments, but I'm running into a
> couple of problems.

What kind of parameters are you intending to experiment with?

> The plan is to choose some perfect (let's say professional) games,
> to define some measure of distance between the moves generated by
> GnuGo and the moves played by the professionals, and to have gnugo
> automatically adjust the coefficients of the evaluation function
> to somehow decrease the distance.
> 
> For this we need :
> 
> (a) to write a library to minimize a function in multidimension,
>      because we want to optimize for many coefficients simultaneously.
>         This is implemented in the attached files minimization.h and
>      minimization.c, see below.

How much theoretical and practical experience do you have with
multivariate optimization? To me it seems optimistic to base this on
conjugate gradients since I would expect a typical goal function to
have lots of local minima.

> (b) to choose a set of games against which we try to fit the
>      parameters. Should we take top-level pro-pro games ?
>      pro-pro handicap games ? NNGS games where Gnugo performs
>      badly at high handicap, and only fit for the white moves ?
>      Any idea ?

I would aim for professional games. Depending on what parameters
you're working with, handicap games may or may not be needed.

> (c) to choose a "reasonable" distance function. This is the more
>      problematic, because (i) we don't know the perfect value of the
>      move played by the profesional

That's absolutely true.

>      (ii) we need a continuous function of the evaluation parameters
>      (for the minimization algo to work),

That depends on the choice of algorithm.

>      so we can't just take the average rank of the pro moves in the
>      move list proposed by gnugo.
> 
>      Arend proposed to take :
> 
>          dist(move) = 1 - (value(professional move) / value(gnugo's top 
> move))
> 
>      and then to minimize
> 
>                 \sum(dist(moves))
> 
>      However, this maybe has the problem ofeliminating any rank
>      information : it's probably worse if the pro move has
>      a 50% value AND is only ranked 10th, compare to having 50%
>      but beinbg second best.

I don't think dropping the rank information is critical, although it
may depend on what kind of positions you're working with.

>         
>         Other possible obvious distances :
> 
>                 (1) dist(move) = value(gnugo's top move) - value(professional 
> move)

That's essentially the same as the previous one except big moves are
given much higher weight. Not clear to me whether that's desirable.

>                 (2) dist(move) = sum( value(gnugo's top move) - value(move in 
> P) )
> 
>                 (3) dist(move) = sum(1 - (value(move in P) / value(gnugo's 
> top move)))
> 
>      Where S is the set of moves ranked higher than the professional 
> move.

I think these are less useful than Arend's proposal.

> 
> Looking at the code, I see that the play_replay() function has
> a global variable "replay_score" that implements something similar
> to (1), so I will probably try to reuse/modify that to test these
> coefficients fit ideas.
> 
> However, that leads to my final questions : How can I add files to
> gungo's Makefiles ? I haven't been able to figure out if I must modify
> something in Makefile.am, Makefile.in, Makefile, configure.in, etc...
> More precesily, here are the files I have and where I want to use them :
> 
> 
> minimization.h, minimization.c :
>           This library implement the conjugate gradient algorithm
>        to find the minimum of a function in multidimension.
>           As they are completely independant of Go, I think
>        I would like to put them in /utils.
> 
> -> Which Makefile should I modify to be able to use the functions in
> minimization.h from the engine afterwards ?
> 
> 
> test_minimization.c :
>           A small test program for the previous library. Self-contained.
> 
> -> Where should I put it ?
> 
> 
> fitting.c, fitting.h (not written yet) :
>        I would like to add these two files to the engine, and be
>        able to call the functions defined in fitting.h from main().
>        How do I do that from the Makefile, etc? :-)

Not at all answering your questions I would recommend doing this
outside the engine, using GTP for communication. I would also
recommend doing it in a language which is substantially higher level
than C, especially when it comes to numerical computations.

/Gunnar




reply via email to

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