Skip to content

Commit

Permalink
Use modified nnue instead of setting spsa params at runtime
Browse files Browse the repository at this point in the history
  • Loading branch information
linrock committed Jul 3, 2024
1 parent 76a564d commit 0541c66
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions worker/games.py
Original file line number Diff line number Diff line change
Expand Up @@ -1134,18 +1134,32 @@ def generate_tune_options(params):
print(cmd)
print()

# use modified nnue instead of setting spsa params at runtime
idx = cmd.index('option.EvalFile=nn-ddcfb9224cdb.nnue')
cmd = (
cmd[:idx]
+ f"option.EvalFile={w_spsa_nnue}"
+ cmd[idx + 1 :]
)
idx = cmd.index('option.EvalFile=nn-ddcfb9224cdb.nnue')
cmd = (
cmd[:idx]
+ f"option.EvalFile={b_spsa_nnue}"
+ cmd[idx + 1 :]
)

# Run cutechess-cli binary.
# Stochastic rounding and probability for float N.p: (N, 1-p); (N+1, p)
idx = cmd.index("_spsa_")
cmd = (
cmd[:idx]
+ (["option.TuneFile=w_tune_options.csv"] if len(w_params) != 0 else [])
# + (["option.TuneFile=w_tune_options.csv"] if len(w_params) != 0 else [])
+ cmd[idx + 1 :]
)
idx = cmd.index("_spsa_")
cmd = (
cmd[:idx]
+ (["option.TuneFile=b_tune_options.csv"] if len(b_params) != 0 else [])
# + (["option.TuneFile=b_tune_options.csv"] if len(b_params) != 0 else [])
+ cmd[idx + 1 :]
)

Expand Down

0 comments on commit 0541c66

Please sign in to comment.