Function inanis::tuning::tuner::run

source ·
pub fn run(
    epd_filename: &str,
    output_directory: &str,
    lock_material: bool,
    random_values: bool,
    threads_count: usize
)
Expand description

Runs tuner of evaluation parameters. The input file is specified by epd_filename with a list of positions and their expected results, and the output_directory directory is used to store generated Rust sources with the optimized values. Use lock_material to disable tuner for piece values, and random_values to initialize evaluation parameters with random values. Multithreading is supported by threads_count.

The tuner is implemented using Texel’s tuning method (https://www.chessprogramming.org/Texel%27s_Tuning_Method), with addition of cache to reduce time needed to get the best result. The loaded positions must be quiet, since the tuner doesn’t run quiescence search to make sure that the position is not in the middle of capture sequence. The cache itself is a list of trends corresponding to the evaluation parameters - it’s used to save the information if the value in the previous iterations was increasing or decreasing, so the tuner can try this direction first. The more times the direction was right, the bigger increasion or decreasion will be performed as next.

The result (Rust sources with the calculated values) are saved every iteration, and can be put directly into the code.