User Interface

AlphaZero.UserInterfaceModule

The default user interface for AlphaZero.

The user interface is fully separated from the core algorithm and can therefore be replaced easily.

source

Session

AlphaZero.UserInterface.SessionType
Session{Env}

A wrapper on an AlphaZero environment that adds features such as:

  • Logging and plotting
  • Loading and saving of environments

In particular, it implements the Handlers interface.

Public fields

  • env::Env is the environment wrapped by the session
  • report is the current session report, with type SessionReport
source

Session CLI (first iteration)

AlphaZero.UserInterface.SessionMethod
Session(::Experiment; <optional kwargs>)

Create a new session from an experiment.

Optional keyword arguments

  • dir="sessions/<experiment-name>": session directory in which all files and reports are saved.
  • autosave=true: if set to false, the session won't be saved automatically nor any file will be generated
  • nostdout=false: disables logging on the standard output when set to true
  • save_intermediate=false: if set to true (along with autosave), all intermediate training environments are saved on disk so that the whole training process can be analyzed later. This can consume a lot of disk space.
source
AlphaZero.UserInterface.saveFunction
save(session::Session)

Save a session on disk.

This function is called automatically by resume! after each training iteration if the session was created with autosave=true.

source

Explorer

Explorer

AlphaZero.UserInterface.exploreFunction
explore(::AbstractPlayer, ::AbstractGameEnv;  [memory])
explore(::AbstractPlayer, ::AbstractGameSpec; [memory])

Start a command interpreter to explore the internals of a player through interactive play.

The memory argument is an optional reference to a memory buffer. When provided, additional state statistics are displayed.

Commands

The following commands are currently implemented:

  • do [action]: make the current player perform action. By default, the action of highest score is played.
  • explore [num_sims]: run num_sims MCTS simulations from the current state (for MCTS players only).
  • go: query the user for a state description and go to this state.
  • flip: flip the board according to a random symmetry.
  • undo: undo the effect of the previous command.
  • restart: restart the explorer.
source