Quick Scripts
The AlphaZero.Scripts module provides a quick way to execute common tasks with a single line of code. For example, starting or resuming a training session for the connect-four example becomes as simple as executing the following command line:
julia --project -e 'using AlphaZero; Scripts.train("connect-four")'The first argument of every script specifies what experiment to load. This can be specified as an object of type Experiment or as a string from keys(Examples.experiment).
Scripts Description
AlphaZero.Scripts.test_game — Functiontest_game(::AbstractGameSpec)
test_game(experiment)Perform some sanity checks regarding the compliance of a game with the AlphaZero.jl Game Interface.
AlphaZero.Scripts.train — Functiontrain(experiment; [dir, autosave, save_intermediate])Start or resume a training session.
The optional keyword arguments are passed directly to the Session constructor.
AlphaZero.Scripts.play — Functionplay(experiment; [dir])Play an interactive game against the current agent.
AlphaZero.Scripts.explore — Functionexplore(experiment; [dir])Use the interactive explorer to visualize the current agent.
AlphaZero.Scripts.dummy_run — Functiondummy_run(experiment; [dir, nostdout])Launch a training session where hyperparameters are altered so that training finishes as quickly as possible.
This is useful to ensure the absence of runtime errors before a real training session is started.
AlphaZero.Scripts.test_grad_updates — Functiontest_grad_updates(experiment; [num_games])Run a gradient update phase using dummy data.
This is useful to ensure that the chosen hyperparameters do not lead to Out of Memory errors during training.