chrisw wrote: ↑Wed Sep 16, 2020 1:53 pm
This looks extremely brilliant. I took a look at the Optuna site docs also. Trying to work out 'how it works', tell me if I understand it right, probably I don't of course.
1. You have a base engine, e1 and same engine, e2, except you can send parameter change instructions to e2
Yes they are the same engine, e1 which I call test engine and e2 as base engine. The e1 will always take the optimizer suggested param values. The e2 will always take the best param values. After a match if e1 wins that is more than 50% score, the param values used by e1 will become the best param values. This best param values then will be used by e2 in the next match. The e1 will take the new suggested values from the optimizer. The score of the match must be reported to the optimizer before taking its suggestions.
2. Uses cutechess tournament mode, with output the result of a quick match (25 rounds?)
Yes, number of game is settable, the more games the better.
3. I'm not sure if parameter changes to a 'quick match' change all five parameters at a time, or just one?
Sorry I don't understand the question.
4. Optuna tries parameter changes (within your supplied range?), and using smart algorithm, decides where to concentrate it's fire, so to speak.
Yes.
5. After N iterations, it gives you new values for the selected parameters.
Yes. They call it trials. A trial can be a 24-game match. After a trial we send the score of the match to the optimizer. After that it is safe to ask for the new suggested param values. Around here
https://github.com/fsmosca/Optuna-Game- ... ner.py#L65
One thing I don't understand are the supplied output graphs, and what they are showing (apart from Optuna deciding that PAWNVAlUE is the 'most important' tunable item.
Slice plot: The y-axis is the score of the engine match, see the objective value label. The x-axis is the value of the parameter that has been tried. The color of the dot is the number of trials, trial number is high if it is dark, see the vertical legend at right. In here we can see if the tuner is making more suggestions that improves the objective value per parameter plot. We can also see here at what range of values has more dots or samples suggested. We can always see the y-axis if the dot performed well or not.
The contour: There is a vertical bar legend at right. The lighter it is, the better. It is the match result of the game match or objective value. Let's take a look at the plot in the intersection of y-axis QueenValueOp and the x-axis RookValueEn. See the light area around south-west, that is the area where QueenValueOp and RookValueEn has good score in the match. The dark area in the plot means that the result of the match on those parameter values are not good.
One other thing. The Optuna presentation says it can handle the functions (cutechess output) in parallel, are you using that feature, or is cutechess script already running the tournament in parallel?
I am using cutechess concurrency to run more than 1 game per trial or match.
I just successfully optimized the king safety weight, mobility weight and passer weight. I have tried improving it before without success but with optuna, I get promising result. See the method I use here.
https://github.com/fsmosca/Optuna-Game- ... timization.