Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Let lc0 switch to another NN during the game (PR 573 rebased to current master) #1452

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

hans-ekbrand
Copy link

This a a rewrite of PR 573 against the current master.

Let lc0 switch to another NN during the game. The intended use case is to combine a stronger general NN with and an NN which is better at endgames.

This patch exports five new UCI-options SecondWeightsFile, SwitchAt, SWCpuct, SWFpuValue, SWPolicyTemperature

SecondWeightsFile defines a path to secondary weights file which substitute the primary weights file when SwitchAtpieces remain on the board. SWCpuct, SWFpuValue, SWPolicyTemperature defines Cpuct, Fpu and PolicySoftmaxTemp to be used with the secondary NN.

This PR has been tested with Sergio Vieri's 128x10 net against itself + Medium Ender, but the PR itself is NN neutral.

To verify that the NN is switched, use the LogFile UCI directive and look for the string Will switch to second NN. For transparency, CPuct, FPU and PolicyTemperature is logged at each move, to clarify when the settings for the second NN is in effect.

@jhorthos
Copy link
Contributor

jhorthos commented Oct 18, 2020

Excellent Hans - thanks. Will probably give it a try even with an inferior end net just to test it out. dkappe has one ender net that is almost as good as T60 and I should have better ones eventually. Oh I see - you already tested with Medium Ender.

One question - do the secondary cpuct values apply to both root and tree cpuct?

@Naphthalin
Copy link
Contributor

@borg323 what is the current status of your hybrid backend, and does it allow switching NNs based on specifyable conditions?

@Naphthalin Naphthalin added the stale Outdated PR, might be closed due to merge conflicts or inactivity label Nov 2, 2022
@borg323
Copy link
Member

borg323 commented Nov 2, 2022

No, but it isn't very hard to do - but it will only work with conditions that can be inferred from the NN input.

@Naphthalin Naphthalin added the enhancement New feature or request label Nov 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request stale Outdated PR, might be closed due to merge conflicts or inactivity
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants