DDPG implementation

The pseudocode that was given in the preceding section already provides a comprehensive view of the algorithm, but from an implementation standpoint, there are a few things that are worth looking at in more depth. Here, we'll show the more interesting features that could also recur in other algorithms. The full code is available in the GitHub repository of the book: https://github.com/PacktPublishing/Reinforcement-Learning-Algorithms-with-Python.

Specifically, we'll focus on a few main parts:

  • How to build a deterministic actor-critic
  • How to do soft updates
  • How to optimize a loss function, with respect to only some parameters
  • How to calculate the target values

We defined a deterministic actor and a critic inside a function ...

Get Reinforcement Learning Algorithms with Python now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.