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

Issue with maybe_flip_fen method #94

Open
simonMoisselin opened this issue Apr 10, 2020 · 5 comments
Open

Issue with maybe_flip_fen method #94

simonMoisselin opened this issue Apr 10, 2020 · 5 comments

Comments

@simonMoisselin
Copy link

Hey, I am using part of your code for a personal project. I have seen an issue with the method maybe_flip_flen. I am not sure it is working correctly. The fundamental problem is that It's using the type of symmetry horizontal center mirror, instead of doing a 180-degree rotation, which is different.

In this image, I believe the knight should be on the top left part of the board instead of the top right.

image

@Akababa
Copy link
Collaborator

Akababa commented Apr 10, 2020

You're completely right from a chess game perspective, the 180 degree rotation is what you would do when looking at the same game from the other side of the board. However from the game state symmetry perspective, you want to "flip" black into a white-like position, so the neural network doesn't have to learn the same position once for black and once for white. In this case, you have to do the horizontal mirroring to get the kings on the right.

As a beside, it's unclear how much (if any) benefit this provides to the training algorithm, but it can't hurt so why not? ¯_(ツ)_/¯

@simonMoisselin
Copy link
Author

Good point!

@simonMoisselin
Copy link
Author

Does it mean that the model is making prediction only when this is WHITE to play?

@Akababa
Copy link
Collaborator

Akababa commented Apr 10, 2020

Yep, this was a while ago but IIRC we actually removed the one-hot color input.

@simonMoisselin
Copy link
Author

The more I think about it, and the 180-degree rotation needs to be done correctly, otherwise you will simulate games that does not make any senses? (they cannot corresponds to game in real life)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants