COMPR[CH]ESS is an innovative approach to lossless chess game compression, seamlessly blending chess engines, machine learning, and Huffman Coding. By training models that predict player moves at a given rating range, this program can adaptively encode/decode chess games efficiently.
Follow these simple steps to get started with COMPR[CH]ESS:
-
Clone the Repository:
git clone https://github.com/tylerrlin/compr_ch_ess.git cd compr_ch_ess -
Install Package:
python setup.py install
-
Run a Script:
python scripts/compress.py <engine_path> <model_path>
python scripts/build_model.py <engine_path>
This program utilizes Huffman Coding to encode/decode chess games. Huffman Coding is a technique where more probable characters or strings of characters are assigned lower-length and unique bitstrings. Using a chess engine to evaluate positions and a machine learning model trained to predict a player's next move, every unique move is encoded and appended to a bitstring containing the code of the whole game. For a hard-coded visualization of this, check out https://tylerrlin.github.io/projects/comprchess.