Learning


KKFChess uses position learning instead of book learning.  This allows the engine to see positions that it had been played before during all phases of the game.  Learning uses the search information it had performed during play hence the engine must play a game in order to learn from it.  It is permissible to have two engines playing against each other and learn from both sides - each learning for it's own colour.

When enabled, learning is performed AFTER the end of each game.  The engine runs through the moves of the game, picking out one that are worth learning.  You can control this worthiness by using the configuration item "LearnDiff".

When a learned position appears in during the game play, the stored score and it's search depth is used to assist in the searching process.  A learned position effectively allows the program to know the score of the position one ply earlier than a search to the same depth.  In analysis mode, looking for a learned position is disabled.

Regular and chess variants supports learning.  The learned files have the following filenames:

Variant Filename for white to move Filename for black to move
Normal / Wild $LearnBase\w_normal.kln $LearnBase\b_normal.kln
Suicide $LearnBase\w_suicide.kln $LearnBase\b_suicide.kln
Atomic $LearnBase\w_atomic.kln $LearnBase\b_atomic.kln
Crazyhouse $LearnBase\w_crazyhouse.kln $LearnBase\b_crazyhouse.kln
Losers $LearnBase\w_losers.kln $LearnBase\b_losers.kln

$LearnBase is the directory specified by the configuration item "LearnBase".

As learning involves the storage of positional scores, it recommended that the learning files to be deleted if changes were made that can affect this score.  e.g. changing the piece's values.  To delete the learned files for the current chess variant, use "learn clean".

As time progresses, the learned files can become large and may have duplicated entries (of increasing search depths).  To eliminate the lesser entries, you can use the "learn opt" console command when you're in the desired variant.  This will create the two optimised files in the current directory.  You must copy these files to the correct directory in order to use these as basis for future learning.

The learned files should be considered temporary since there's a limit on the amount of learned positions that can be stored in memory.  If a position is very good or very bad, consider putting it in a book line and create a new opening book.

Learning hash table size can be adjusted.