Code
Code
Three changes to DDPG
The overestimation comes from the actor update, which acts as a max over noisy critic estimates. The actor moves its output toward actions where the critic’s value is high. Where the critic has an error that happens to be positive, the actor moves there and stays, and the bootstrapped targets then carry that error back to earlier states. Each change below removes one route for it.Clipped double Q-learning
TD3 trains two critics, and , on the same targets, and builds the target from the smaller of their two target networks: The same upward bias affects tabular Q-learning, whose target takes a max over noisy table entries. Double Q-learning (van Hasselt, 2010) removed it there with two tables: one picks the best next action, and the other evaluates it. TD3 adapts that idea to two critics and takes the minimum. An error that inflates one critic is unlikely to inflate the other at the same action, so the minimum tends to come out too low. A low bias is safer here: the actor avoids actions that look worse than they are, instead of seeking actions that look better.Target policy smoothing
The next action in the target is the target actor’s output plus clipped noise, The critic then learns the value of a small neighborhood of actions, not of a single point. A narrow spike in that the actor could exploit is averaged away. Both this change and the previous one alter only the TD target . The critics still minimize the squared TD error, as in DDPG.Delayed policy updates
The critics update on every step, and the actor and all target networks update every second step. The actor then follows a critic whose errors have had time to shrink. Everything else, from the network sizes to the replay buffer, the exploration noise and the step sizes, is the DDPG setup of the previous section. The training function below marks the three changes.Code
Code
Code
Code
The reward decides the behavior
The page that defined this MDP chose a collision penalty of 20 next to a goal bonus of 20. Here is the same training with the collision penalty raised to 200 and everything else unchanged:Code
Code
From simulation to the robot
Everything above ran in a 2D simulation with perfect geometry. A policy trained this way meets several differences on a real TurtleBot3:- The lidar is noisy, drops returns on dark or shiny surfaces, and sees chair legs and people that are not disks.
- The robot has inertia and motor limits, and its commands arrive with a delay, so is not applied exactly or at once.
- The goal’s distance and bearing come from odometry or localization, which drift and jump.
- The room is new. The policy saw four fixed obstacles in a 4 m square.
References
- Niu, H., Ji, Z., Arvin, F., Lennox, B., Yin, H., et al. (2021). Accelerated Sim-to-real deep reinforcement learning: Learning collision avoidance from human player. arXiv [cs.AI]. Link
Found an error on this page? Report an issue.

