Chess AIs
This project took about 4h of code writing and 1
night of ai training. I have created a program to
train the AIs using
chess.js
and
NEAT.js
and a program to play against them with
chess.js
and chessboard.js.
The AIs learn to play by them selves, 10 AIs play
each generation each playing 9 games. They earn 1
point for drawing and 2 points for winning although
this may need to be revised as it causes them to
play extremely defensively, so next time I might
give points for winning in fewer moves and more
points for winning rather than drawing.
The training does 1000 generations which I ran
overnight on my raspberry-pi; it then prints the
exported model to the console. The pre-trained model
works right out of the box.
This can be done with algorithms but I opted for the
lazy option and used
neuroevolution.
ONLY PRESS THE TRAINING BUTTON IF YOU WANT TO
TRAIN 1000 GENERATIONS BECAUSE IT MAY CRASH YOUR
BROWSER FOR 16 HOURS.
Train them Play against them