Very useful information!

For all puzzles I use the solutions of this competition))

Good luck!

1 Like

Thank you @victorkras2008, as you said, it’s very useful !

I like the idea of splitting the chessboard image into 64 smallest ones (for each chessboard case).

I’m trying to replicate some codes, especially the functions onehot_from_fen() and fen_from_onehot() which transform FEN notation into matrix (and reverse). I suppose you also used such functions, so I allow some questions, maybe you can help me.

Q) What is the shape of an example onehot_from_fen() result? I tried it, and the output is an array with 64 rows (one for each case of the chessboard) per 13 columns (one for each piece possibility, empty included). Each row contains all 0 values, except one 1. Is it the expected output/shape?

When I look at the next function, fen_from_onehot(), there are two loops (j in range(8) and i in range(8), so I have the feeling the input parameter should be an array of 8 rows per 8 columns. Which not correspond with the previous result. If I run the 2 functions back to back, it didn’t find the initial fen string.

Did I miss a step where the output array (64 x 13) is transformed, each row (of all 0 except one) is replaced by the column position where the non-zero is?
Example: (0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0) —> 3

The following assumptions is it true : fen_from_onehot(onehot_from_fen(fen)) will return fen ?

Thank you in advance for your response!
Sylvain

1 Like

I finally managed to replicate the code with success!

My assumptions that fen_from_onehot(onehot_from_fen(fen)) will give the initial fen was wrong. The two function are not built for this. The output describe above (64 per 13) was right.

But thank you anyway.

1 Like

Hi @demarsylvain
You can find my notebook here

1 Like

I’m not so familiar with python langage and I had difficulties to reorder correctly the predictions of the model. I finally managed to fix it yesterday, after some trials and errors.

I already write a notebook to share my experience, one part is very similar to yours, as it come from the Kaggle link you shared above.

1 Like