1. Learn
  2. /
  3. Courses
  4. /
  5. Deep Reinforcement Learning in Python

Connected

Exercise

The double-ended queue

Familiarize yourself the with Double-Ended Queue data structure which you will use as replay buffer.

The Double Ended Queue, or deque is a limited capacity queue which 'forgets' its oldest items as new items are added over time. This provides a well suited abstraction to support the replay buffer.

Instructions 1/3

undefined XP
  • 1
    • Append the integer 10 to the right side of the Double-Ended Queue.
  • 2
    • Set a maximum capacity of 5 as the maxlen argument; observe what happens to when we try to append beyond the queue's capacity.
  • 3
    • Draw a random sample of three items from the buffer.