Solving Your Own Games
Here are some recommended steps for using AlphaZero.jl on your own game.
- Implement the Game Interface for your game or wrap a CommonRLInterface environment. You can look at the examples in the
games
directory for inspiration. - Once you have defined an
AbstractGameSpec
, you can useScripts.test_game
to run a series of sanity checks on your implementation. - Define your neural network architecture or reuse one from the Networks Library.
- Think about your training hyperparameters and define an
Experiment
. Once again, you may draw inspiration from the provided examples. - Before running a complete training session, you can use
Scripts.dummy_run
to check the absence of potential runtime errors in your code. You can also useScripts.test_grad_updates
to run a gradient update step on dummy data in order to check that your GPU has enough memory to accomodate your current choice of hyperparameters. - Run a training session using
Scripts.train
. You can interrupt training at any moment and resume it later since the current state of your agent is saved automatically in thesessions
folder after each iteration. - Look at the generated plots and reports and adapt your hyperparameters if necessary. Also, you can visualize your current agent using
Scripts.explore
.
If you've managed to train a successful agent, please consider sharing your experience with us by opening an issue on Github or posting on the Julia Discourse forum.