You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
How to use blunder prediction for given position/fen + next move #32
I am trying to use blunder prediction for my hobby project I plan to work on - what I need is to predict blunder probability for given move at given position - how do I do it ?
P.S. I would rather avoid training my own blunder prediction model
You should be able to load our models with the standard Pytorch load function. They don't use or predict the next move though, just the board (and metadata for some models) to predict the binary will_blunder. Then the code in the validate_batch method is how we run the analysis. It's all done in large batches for efficiency so running on a singe position might require some tinkering.
Can you sanity check that on your installation and check what is probability of a blunder in that setup ?
What is the extra_x dict exactly, I think I understand active_elo (player to move elo, right?), opponent_elo (obvious I hope) but I am very unsure about move_ply, clock_percent and cp_rel
I don't have an easy way to run the models. This project is in an archive and the machine we used has been reallocated. So I can't check that.
You're correct about the first two values, move_ply is the ply of the current move the first move is ply 1, same indexing as Lichess. clock_percentage is the remaining time as a percentage of the initial clock, I think we assume game will be 30 moves/60 ply if there's an increment. And cp_rel is the centipawn, times 100 so actually pawns, evaluation of the position by stockfish, we do it relative instead of absolute so multiply by -1 if the active player is black.
Activity
reidmcy commentedon Dec 16, 2021
You should be able to load our models with the standard Pytorch load function. They don't use or predict the next move though, just the board (and metadata for some models) to predict the binary
will_blunder. Then the code in thevalidate_batchmethod is how we run the analysis. It's all done in large batches for efficiency so running on a singe position might require some tinkering.int8 commentedon Dec 16, 2021
all right, seems like your advice + #10 helped me :)
The next step for me is to map FEN into tensor so I can pass it to forward call - any helper function I could use?
int8 commentedon Dec 16, 2021
ok - found it,
now I am here:
which is sort of critical moment of fried liver attack: https://lichess.org/analysis/standard/r1bqkb1r/ppp2ppp/2n2n2/3Pp1N1/2B5/8/PPPP1PPP/RNBQK2R_b_KQkq_-_0_5
extra_x dictexactly, I think I understandactive_elo(player to move elo, right?),opponent_elo(obvious I hope) but I am very unsure aboutmove_ply,clock_percentandcp_relreidmcy commentedon Dec 17, 2021
I don't have an easy way to run the models. This project is in an archive and the machine we used has been reallocated. So I can't check that.
You're correct about the first two values,
move_plyis the ply of the current move the first move is ply 1, same indexing as Lichess.clock_percentageis the remaining time as a percentage of the initial clock, I think we assume game will be 30 moves/60 ply if there's an increment. Andcp_relis the centipawn, times 100 so actually pawns, evaluation of the position by stockfish, we do it relative instead of absolute so multiply by -1 if the active player is black.zodwick commentedon Jun 12, 2024
hey @int8 any progress on this, have you figured out how to do the prediction based on fen ?