April 2020
Intermediate to advanced
380 pages
9h 24m
English
To train the agent, we need to create the util/trainer.py file, which provides the train() function. Let's take a look:
train(state, nn, filename, args = {})
The function accepts a State class, a neural network class, and other arguments. It also accepts a filename, which is the path of the file containing the generated gameplays. After training, we have the option of saving the output to another model file, as provided in the train() function of the command/train.py file.
usage: run.py train [-h] [--progress, help='show progress bar'] [--epoch EPOCH, help='training epochs'] [--batch BATCH, help='batch size'] [--block BLOCK, help='block size'] [--gpu ...
Read now
Unlock full access