Skip to content

Commit

Permalink
Improve default parameters
Browse files Browse the repository at this point in the history
This closes #80
  • Loading branch information
kiudee committed Aug 24, 2020
1 parent 215b93d commit df57383
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 23 deletions.
5 changes: 5 additions & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@
History
=======

0.6.0-beta.1 (2020-08-24)
-------------------------
* Improve default parameters to be slightly more robust for most use cases and
be more in line with what a user might expect.

0.6.0-beta.0 (2020-08-24)
-------------------------
* Add support for time per move matches (option ``st`` in cutechess-cli).
Expand Down
22 changes: 13 additions & 9 deletions docs/parameters.myst
Original file line number Diff line number Diff line change
Expand Up @@ -134,13 +134,13 @@ fitting process:
* - `"acq_function"`
- `-a --acq-function TEXT`
- The search strategy used by the tuner. The following values are possible:
* `"mes"` (default): Max-value entropy search tries to sample points which
* `"mes"`: Max-value entropy search tries to sample points which
yield a lot of information about the value of the optimum.
A good allrounder strategy leaning on the exploitative side.
* `"pvrs"`: Predictive variance reduction search tries to sample points
which reduce the uncertainty of promising regions as much as possible.
Another good allrounder strategy, which compared to `mes` focuses more
on exploration. Is slightly more robust.
* `"pvrs"` (default): Predictive variance reduction search tries to sample
points which reduce the uncertainty of promising regions as much as
possible. Another good allrounder strategy, which compared to `mes`
focuses more on exploration. Is slightly more robust.
* `"vr"`: Variance reduction picks points which reduce the overall
uncertainty as much as possible. This is not useful to find the best
configuration, but to fit the optimization landscape very precisely.
Expand Down Expand Up @@ -179,7 +179,7 @@ fitting process:
* - `"rounds"`
-
- Number of rounds to play in the match (each round consists of 2 games).
[default: 5]
[default: 10]
* - `"engine1_tc"`
-
- Time control to use for the first engine. Can be a non-increment time
Expand Down Expand Up @@ -216,7 +216,7 @@ fitting process:
-
- Specify, if cutechess-cli is allowed to adjudicate draws, if the scores of
both engines drop below draw_score for draw_movecount number of moves.
Only kicks in after draw_movenumber moves have been played. [default: True]
Only kicks in after draw_movenumber moves have been played. [default: False]
* - `"draw_movenumber"`
-
- Number of moves to play after the opening, before draw adjudication is
Expand All @@ -235,7 +235,7 @@ fitting process:
- Specify, if cutechess-cli is allowed to adjudicate wins/losses based on the
engine scores. If one engine’s score drops below -resign_score for
resign_movecount many moves, the game is considered a loss for this engine.
[default: True]
[default: False]
* - `"resign_movecount"`
-
- Number of consecutive moves one engine has to output a score below the
Expand Down Expand Up @@ -283,14 +283,18 @@ fitting process:
* - `"plot_every"`
- `--plot-every INTEGER`
- Plot the current optimization landscape every n-th iteration. Set to 0 to
turn it off. [default: 0]
turn it off. [default: 1]
* - `"plot_path"`
- `--plot-path PATH`
- Path to the directory to which the tuner will output plots.
[default: plots]
* - `"random_seed"`
- `--random-seed INTEGER`
- Number to seed all internally used random generators. [default: 0]
* - `"result_every"`
- `--result-every INTEGER`
- Output the current optimum, its score estimate and confidence intervals
every n-th iteration. Set to 0 to turn it off. [default: 1]
* -
- `--resume / --no-resume`
- Let the optimizer resume, if it finds points it can use.
Expand Down
16 changes: 8 additions & 8 deletions tune/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ def run_server(verbose, logfile, command, experiment_file, dbconfig):
@click.option(
"-a",
"--acq-function",
default="mes",
default="pvrs",
help="Acquisition function to use for selecting points to try. "
"Can be {mes, pvrs, ei, ts, vr}.",
show_default=True,
Expand Down Expand Up @@ -179,7 +179,7 @@ def run_server(verbose, logfile, command, experiment_file, dbconfig):
)
@click.option(
"--n-initial-points",
default=30,
default=16,
help="Size of initial dense set of points to try.",
show_default=True,
)
Expand All @@ -193,7 +193,7 @@ def run_server(verbose, logfile, command, experiment_file, dbconfig):
)
@click.option(
"--plot-every",
default=0,
default=1,
help="Plot the current optimization landscape every n-th iteration. "
"Set to 0 to turn it off.",
show_default=True,
Expand All @@ -212,7 +212,7 @@ def run_server(verbose, logfile, command, experiment_file, dbconfig):
)
@click.option(
"--result-every",
default=5,
default=1,
help="Output the actual current optimum every n-th iteration."
"The further you are in the tuning process, the longer this will take to "
"compute. Consider increasing this number, if you do not need the output "
Expand All @@ -230,7 +230,7 @@ def run_server(verbose, logfile, command, experiment_file, dbconfig):
)
def local( # noqa: C901
tuning_config,
acq_function="mes",
acq_function="pvrs",
acq_function_samples=1,
confidence=0.9,
data_path=None,
Expand All @@ -239,12 +239,12 @@ def local( # noqa: C901
gp_initial_burnin=100,
gp_initial_samples=300,
logfile="log.txt",
n_initial_points=30,
n_initial_points=16,
n_points=500,
plot_every=5,
plot_every=1,
plot_path="plots",
random_seed=0,
result_every=5,
result_every=1,
resume=True,
verbose=False,
):
Expand Down
12 changes: 6 additions & 6 deletions tune/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ def _construct_engine_conf(


def run_match(
rounds=5,
rounds=10,
engine1_tc=None,
engine2_tc=None,
engine1_st=None,
Expand All @@ -187,11 +187,11 @@ def run_match(
engine2_npm=None,
timemargin=None,
opening_file=None,
adjudicate_draws=True,
adjudicate_draws=False,
draw_movenumber=1,
draw_movecount=10,
draw_score=8,
adjudicate_resign=True,
adjudicate_resign=False,
resign_movecount=3,
resign_score=550,
adjudicate_tb=False,
Expand All @@ -204,7 +204,7 @@ def run_match(
Parameters
----------
rounds : int, default=1
rounds : int, default=10
Number of rounds to play in the match (each round consists of 2 games).
engine1_tc : str or TimeControl object, default=None
Time control to use for the first engine. If str, it can be a
Expand All @@ -230,7 +230,7 @@ def run_match(
Path to the file containing the openings. Can be .epd or .pgn.
Make sure that the file explicitly has the .epd or .pgn suffix, as it
is used to detect the format.
adjudicate_draws : bool, default=True
adjudicate_draws : bool, default=False
Specify, if cutechess-cli is allowed to adjudicate draws, if the
scores of both engines drop below draw_score for draw_movecount number
of moves. Only kicks in after draw_movenumber moves have been played.
Expand All @@ -245,7 +245,7 @@ def run_match(
engines drops below this value for draw_movecount consecutive moves,
and there are no captures and pawn moves, the game is adjudicated as
draw.
adjudicate_resign : bool, default=True
adjudicate_resign : bool, default=False
Specify, if cutechess-cli is allowed to adjudicate wins/losses based on
the engine scores. If one engine’s score drops below -resign_score for
resign_movecount many moves, the game is considered a loss for this
Expand Down

0 comments on commit df57383

Please sign in to comment.