Let's first code the model.py file. The steps involved in this are as follows:
- Import the required packages:
import numpy as npimport sysimport osimport randomimport tensorflow as tf
- Choose the bigger or smaller network: We will use two neural network architectures, one called bigger and the other smaller. Let's use the bigger network for now; the interested user can later change the network to the smaller option and compare performance:
NET = 'bigger' # 'smaller'
- Choose the loss function (L2 loss or the Huber loss): For the Q-learning loss function, we can use either the L2 loss or the Huber loss. Both options will be used in the code. We will choose huber for now:
LOSS = 'huber' # 'L2'
- Define neural network ...