Skip to content

Instantly share code, notes, and snippets.

@davidADSP
Last active December 1, 2019 14:44
Show Gist options
  • Save davidADSP/d0bc05f1deca4fa0c21348513727a646 to your computer and use it in GitHub Desktop.
Save davidADSP/d0bc05f1deca4fa0c21348513727a646 to your computer and use it in GitHub Desktop.
# Each self-play job is independent of all others; it takes the latest network
# snapshot, produces a game and makes it available to the training job by
# writing it to a shared replay buffer.
def run_selfplay(config: MuZeroConfig, storage: SharedStorage,
replay_buffer: ReplayBuffer):
while True:
network = storage.latest_network()
game = play_game(config, network)
replay_buffer.save_game(game)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment