Terra Help and Information

bullet1 Help!

bullet2 Learning

bullet3 What is learning

Chess programs are mainly using "root learning" meaning that they basically are trying to avoid bad moves or prefer good  moves (or positions) depending on previous results. The learning is at move or position level and not generalized in any way. A more sophisticated type of learning would be trying to generalize, like learning that the knight is bad in the corner or the King should try to avoid being in the center in the middle game etc. This kind of learning does not keep track of certain moves or certain positions. Instead a higher level of knowledge and more complex structures are needed. As far as I know, no top program is using generalized learning in this way.

bullet3 Terra's learning

Terra is learning from both mistakes and successes. The learned score is added to the moves in the book that was used for the current game. Next time when Terra reaches the same position in the book (or the Postbook), moves will be chosen depending on Terra's previous performance for each of the moves in the position.

The Learning will make Terra to adjust it's selection of moves from the the Book and PostBook.

In the Book we have following information that will be changed:

  1. Terra's performance for each used book move.
  2. The number of games Terra have played for each book move

These are called the Dynamic values in the book. If the user sets some own values (either with the bookeval command or by creating PGN-files with !- and ?-symbols  and merge that file into the book) they are overriding the Terra values and no learning will take place for these moves. The book will contain the user set values until removed.

The Postbook has similar fields but it's about moves outside the book.

All the learning takes place in these values (except for the user set values).


When Terra will select a move from the book it is by choosing between moves and using values from either:

  • User set values (if any) for the move
  • Terra's performance, Dynamic values  as described above (if any) for the move
  • The Fixed values  for the move

The method to use is controlled by the RandomType option  in Terra.ini


See also How Terra selects a move from books .

  • Book learning
    When Terra reaches a certain position and is to move, the first thing to do is to look in the book to find all the known book moves for this position. Each move has it's own value stored (set by user, based on Terra's previous performance with this move). If we don't have this value, or it's not based on enough number of games (see TerraLim),  we also have the statistics that was loaded when the book was created. This statistics is based on the results in all the loaded games. When all the moves for a certain position are collected they each have a value set according to above. Now Terra has to make a move choice and that is done depending on the RandomType parameter.

    See Terra book.


     
  • Postbook learning
    The post book is handled completely by Terra internally.

    When Terra is out of book the post book is build by the first about 10 positions after. Each position will get it's value from the search score and the final result. The post book is a way to extend the normal book a few moves. This file will help Terra to better handle openings that is hard to understand. Some openings are too complex, due to long range planning, for chess computers. Terra will avoid the most obvious mistakes and go for the good plans.

    The Postbook is an ASCII file that holds the positions together with information. The file can be opened and edited by a text editor but it's not my recommendation!

    Delete the postbook.dat file (under book directory) when things has changed a lot. i.e. You have a new book or a new version of Terra.If something seems to be wrong with this file jut delete it.


     

bullet3 How to set learning options

Learning options are only applicable if Book on. If Booklearn off, no new learning will take place but what is learned so far will be used.

The options that affects the learning procedure are:


Book=1 or 0
use Book for selecting moves or not (0 means also that BookLearn=0)
PostBook=1 or 0
use PostBook for selecting moves or not (0 means also  PostLearn=0)
BookLearn=1 or 0
update Book with the learning or not
PostLearn=1 or 0
update PostBook file with new learned data or not
BookLimit=x,  where x in [0-100]
lowest acceptable win% in order to be used otherwise the move is put into the "Avoid list" and will not be selected. This parameter is only tested if Terra values isn't used and MinBookGames is met.
MinBookGames=x
lowest acceptable # of games loaded with this move. This parameter is only relevant if Terra values doesn't match or aren't used.
RandomType=1,2,3,4
Type of selection method for book moves.
This value controls what method to use when selecting one of many possible book moves. We have two types of values to use:
  • Fixed values:  The statistics set when creating the book files.
  • Dynamic values : The results from the Terra games with this opening book.
The different options are:
  1. Use the Terra values if MinTerraGames is met. If not, use the frequency value from the Fixed values if MinBookGames is met. If not, this move is not considered at all.
  2. As in 1 but the selection is randomized, among moves, with a Bell curve distribution
  3. Use the frequency value from the Fixed values if MinBookGames is met.
  4. As in 3 but the selection is randomized, among moves, with a Bell curve distribution
TerraLimit=x,  where x in [0-100]
lowest acceptable Win% for Terra, in order to use the move. Otherwise the move is put in the "Avoid list" and not selected. This parameter is only tested if MinTerraGames is met.
MinTerraGames=x, where x >= 0
lowest acceptable # of games before using Terra's own statistics


Please give your comments in WinBoard Forum or email me. This document was updated 2004-08-02.