The ChessAIThon project (2025-1-ES01-KA220-VET-000354329) is co-funded by the European Union. The views and opinions expressed in this publication are those of the author(s) only and do not necessarily reflect those of the European Union or the Spanish Service for the Internationalisation of Education (SEPIE). Neither the European Union nor the National Agency SEPIE can be held responsible for them.
Table of Contents
Mask Implementation
Students apply this legal information as a mask, multiplying the 4096-probability output vector by a 4096-vector containing 0s for illegal moves. This guarantees that only the legal move with the highest probability (the argmax of the valid moves) is chosen. This strategy ensures the AI's legality without forcing the CNN to learn the rules directly.