Last active
December 1, 2019 22:02
-
-
Save davidADSP/2bb4814c4d4a2b3528fc466d974796d6 to your computer and use it in GitHub Desktop.
ReplayBuffer (https://arxiv.org/src/1911.08265v1/anc/pseudocode.py)
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class ReplayBuffer(object): | |
def __init__(self, config: MuZeroConfig): | |
self.window_size = config.window_size | |
self.batch_size = config.batch_size | |
self.buffer = [] | |
def save_game(self, game): | |
if len(self.buffer) > self.window_size: | |
self.buffer.pop(0) | |
self.buffer.append(game) | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment