jk182 / chessProjects

GNU General Public License v3.0
10 stars 1 forks source link

Question about LC0 sharpness calcuation #1

Open Charles-Wu-Chen opened 1 month ago

Charles-Wu-Chen commented 1 month ago

https://github.com/jk182/chessProjects/blob/7bbb6f4944947fc0f43146b16ff6031cd2cb18ad/functions.py#L76

https://x.com/LeelaChessZero/status/1637763896596463616

this line of code is different with the one suggested by LC0 . I am not math expert, but wondering why there is max( ) to cut off all the negative values (which can be a very big negative double).

Thanks in advance for the answers

jk182 commented 1 month ago

Yes, this is meant to avoid negative values which would then be counted as sharp positions due to the square. In general, this formula doesn't work well for cases where one side has a big advantage, so I tried different things to avoid this but found nothing elegant yet.