Skip to content

Latest commit

 

History

History
66 lines (45 loc) · 2.33 KB

File metadata and controls

66 lines (45 loc) · 2.33 KB

chmengine

The chmengine module is an Easter egg component of the ChessMoveHeatmap project. This module provides a chess engine that uses the data produced by the heatmaps to pick moves and allows for playing or training the engines.

Usage - Play CMHMEngine (aka: Cmhmey Sr.)

Below is an example of how to use the chmengine module to play a game against the CMHMEngine engine using the PlayCMHMEngine class.

from chmengine import PlayCMHMEngine

# Initialize the PlayCMHMEngine
game_manager = PlayCMHMEngine(player_name="Phillyclause89")

# Play a game against the engine, CMHMEngine picks moves via various definite algorithms 
# Use pick_by param to specify what arg gets passed to the CMHMEngine instance.
game_manager.play(pick_by="delta")

Usage - Play CMHMEngine2 (aka: Cmhmey Jr.)

Below is an example of how to use the chmengine module to play a game against the CMHMEngine2 engine using the PlayCMHMEngine class.

from chmengine import PlayCMHMEngine, CMHMEngine2

# Initialize the PlayCMHMEngine
game_manager = PlayCMHMEngine(engine=CMHMEngine2, player_name="Phillyclause89", player_color='black')

# Cmhmey Jr. only has one pick_by algorithm that evolves through reinforcement learning updates
game_manager.play(pick_by="CMHMEngine2")

Usage - Train CMHMEngine2 (aka: Cmhmey Jr.)

Below is an example of how to use the chmengine module to train the CMHMEngine2 engine using the PlayCMHMEngine class.

from chmengine import PlayCMHMEngine, CMHMEngine2

# Initialize the PlayCMHMEngine
game_manager = PlayCMHMEngine(engine=CMHMEngine2)

# Cmhmey Jr. only has one pick_by algorithm that evolves through reinforcement learning updates
game_manager.train_cmhmey_jr(training_games=1)  # 1 training game is expected to take about ~45 minutes 

Click the image below to watch Cmhmey Jr. Train On YouTube!

Watch Cmhmey Jr. Train On YouTube!

License

This project is licensed under the MIT License. See the LICENSE file for details.


Feel free to adjust any sections as needed to better fit the specifics of your project!