Training code
We have two very similar training modules in this example: one for the feed-forward model and one for 1D convolutions. For both of them, there is nothing new added to our examples from Chapter 8:
-
They’re using epsilon-greedy action selection to perform exploration. The epsilon linearly decays over the first 1M steps from 1.0 to 0.1.
-
A simple experience replay buffer of size 100k is being used, which is initially populated with 10k transitions.
-
For every 1,000 steps, we calculate the mean value for the fixed set of states to check the dynamics of the Q-values during the training.
-
For every 100k steps, we perform validation: 100 episodes are played on the training data and on previously unseen quotes. Validation results are recorded in TensorBoard, such as the mean profit, the mean count of bars, and the share held. This step allows us to check for...