bug-gnubg
[Top][All Lists]
Advanced

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

[Bug-gnubg] Re: What does the trainer function do?


From: Joseph Heled
Subject: [Bug-gnubg] Re: What does the trainer function do?
Date: Wed, 23 Jun 2004 08:32:46 +1200
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7) Gecko/20040616


This is the hard part - documenting this stuff to the point it is easier to dive in. I am going to try, but it will be slow.

The best right now is to read the python code in the scripts

Øystein O Johansen wrote:
Hi,

In the python interface there's a function 'trainer'. What does that do?
And what's all the DATA? c_* ? p_* ? ro_* ?


From train.py - with added comments:
------------------------------------------------
# read training data. See my previous post for the location of existing training # data files
data = readData(dataFileName)

nPos = len(data)

# Should training ignore backgammons?
ignoreBGs = ignoreBG or targetClass == gnubg.c_race

# last 3 args are optional, pretty obscure cases, BTW.
# Third argument is true if you want to train the
# small pruning nets. iTrain is a list of input positions to train. Part of my
# experiments.
#
trainer = gnubg.trainer(data, ignoreBGs, 0, iTrain)

del data
-----------------------------------------------

p_* : special plies values. For example, gnubg.probs(pos, gnubg.p_osr) evaluates pos using the osr method.

c_* : evaluation class. (c_contact, c_race, etc)

ro_* : (rollout over). One of the optional arguments to gnubg.rollout(). say gnubg.rollout(..., level= ro_bearoff), to force the rollout to stop only at bearoff positions (since the default for contact is to stop at race).

-Øystein





reply via email to

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