Exercises

As always, use the exercises in this section to get a better understanding of the material you learn. Try to work through at least two or three exercises in this section:

  1. Return to the example Chapter_5_1.py and change the alpha (learning_rate) variable and see what effect this has on the values calculated.
  2. Return to the example Chapter_5_2.py and alter the arm positions on the various bandits.
  3. Change the learning rate on the example Chapter_5_2.py and see what effect this has on the Q results output.

  1. Alter the gamma reward discount factor in the Chapter_5_3.py example, and see what effect this has on agent training.
  2. Change the exploration epsilon in the Chapter_5_3.py to different values and rerun the sample. See what effect altering the various exploration parameters has on training the agent.
  3. Alter the various parameters (exploration, alpha, and gamma) in the Chapter_5_4.py example and see what effect this has on training.
  4. Alter the size of the memory in the Chapter_5_4.py example, either higher or lower, and see what effect this has on training.
  5. Try to use different Gym environments in the DQNAgent example from Chapter_5_5.py. You can do a quick Google search to see the other possible environments you can choose from.
  6. The Chapter_5_6.py example currently uses a form-exploration policy called LinearAnnealedPolicy; change the policy to use the BoltzmannQPolicy policy as mentioned in the code comments.
  7. Be sure to download and run other Keras-RL examples from https://github.com/keras-rl/keras-rl. Again, you may have to install other Gym environments to get them working.

There are plenty of other examples, videos, and other materials to study with respect to RL. Learn as much as you can, as this material is extensive and complex and not something you will pick up overnight.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset