Skip to main content
Open In Colab Q-learning for Robot Navigation kept five steering commands and learned a table over 216 coarse states. The table could not tell apart the many situations that share one state. This section keeps the five commands and gives the agent the full 28-number observation of Robot Navigation as an MDP: the 24 lidar ranges, the goal’s distance and bearing, and the previous command. A neural network takes the place of the table. As in the other navigation sections, the agent treats the observation as if it were the state, although the state is the robot’s pose. The agent is the deep Q-network of Q-learning with Function Approximation, with its replay buffer and target network, and Double DQN as a variant. The simulator, reward and episode rules are the ones of Robot Navigation as an MDP.

Five commands, a network for the action values

The five commands are the ones of the tabular agent. Each turns at a fixed rate, and the sharper turns drive more slowly: The network maps the 28 numbers to five action values Q(o,a;w)Q(o, a; \mathbf w), one per command, so the greedy action is the argmax of its output.

Training

Training follows the DQN section. The agent acts ϵ\epsilon-greedily, with ϵ\epsilon falling from 1 to 0.05 over the first 30% of the 100,000 steps. It stores every transition in a replay buffer, learns from random minibatches of 256 transitions, and computes its targets with a target network that is copied from the trained network every 2,000 steps. The loss is the Huber loss of the TD error. Double DQN changes only the target: the trained network picks the next action, and the target network evaluates it. A goal or a collision ends the target; after a timeout the target still bootstraps, because the robot still has a future. Every 10,000 steps the code runs the greedy policy on 50 fixed episodes and records three numbers: the success rate, the network’s estimate max⁡aQ(s0,a)\max_a Q(s_0, a) of the start states, and the discounted return actually collected from them. The return is measured as on the DDPG page, by letting each episode run past the timeout, so the two pages can be compared.
Output from cell 6 Left: greedy success rate on the 50 evaluation episodes. Right: the network’s estimate of the start states’ value (solid) and the discounted return actually collected from them (dashed). Both agents learn the task, and neither collapses the way the DDPG actor does. Double DQN reaches the goal in 60% of the evaluation episodes after 40,000 steps and stays between 70% and 84% from 50,000 steps on. DQN rises later, dips twice, peaks at 90% after 90,000 steps and ends at 72%. The right panel shows no overestimation in this run. The estimates rise slowly from zero and stay below the returns once the agents reach the goal regularly. At the end they are 3.6 and 2.6, against returns of 5.9 and 9.6. The target network is copied only every 2,000 steps, so after 100,000 steps the bootstrapped values have not yet caught up with the returns. On CartPole, the DQN section shows the same pattern before its estimates overtake the returns. One difference from DDPG is the size of the max: here it runs over five fixed commands, while the DDPG actor searches a continuous range of commands for the critic’s highest value.

Test on the common episodes

The final networks, not the best checkpoints, run on the same 300 test episodes as the go-to-goal controller and the tabular agent.
The final DQN network reaches the goal in 79% of the 300 test episodes and collides in 21%. The final Double DQN network reaches it in 84% and collides in 16%. Neither times out. The tabular agent of Q-learning for Robot Navigation reaches the goal in 81% of the same episodes. With only five commands and 100,000 steps of training, the network and the full observation change the result by a few points: Double DQN does a little better than the table, and plain DQN a little worse. DDPG for Robot Navigation keeps the network and drops the five commands: its actor outputs any speed and turn rate. Key references: (Mnih et al., 2015; Sutton & Barto, 2018)

References

  • Mnih, V., Kavukcuoglu, K., Silver, D., Rusu, A., Veness, J., et al. (2015). Human-level control through deep reinforcement learning. Nature. DOI
  • Sutton, R., Barto, A. (2018). Reinforcement Learning: An Introduction. Link

Found an error on this page? Report an issue.