April 2020
Intermediate to advanced
380 pages
9h 24m
English
So far, we've talked about the util/gameplay.py file to demonstrate the code in the file that pertains to move-making rules – specifically, the self-play function of the file. Now, we'll take a look at how these self-plays can run in iteration to generate a complete gameplay log. Let's get started:
def generate(self, state, nn, cb, args): self.mcts = MCTS(nn) iterator = range(args['selfplay']) if args['progress']: from tqdm import tqdm iterator = tqdm(iterator, ncols = 50) # self play for pi in iterator: result = self._selfplay(state, args) if cb != None: cb(result)
Essentially, this function takes care of running the ...
Read now
Unlock full access