Sven Mika d5bfb7b7da [RLlib] Preparatory PR for multi-agent multi-GPU learner (alpha-star style) #03 (#21652) 2 年之前
..
tests d5bfb7b7da [RLlib] Preparatory PR for multi-agent multi-GPU learner (alpha-star style) #03 (#21652) 2 年之前
README.md eae7a1f433 [RLLib] Readme.md Documentation for Almost All Algorithms in rllib/agents (#13035) 3 年之前
__init__.py 3d2e27485b [RLlib] Trainer sub-class DQN/SimpleQ/APEX-DQN/R2D2 (instead of using `build_trainer`). (#20633) 2 年之前
apex.py d5bfb7b7da [RLlib] Preparatory PR for multi-agent multi-GPU learner (alpha-star style) #03 (#21652) 2 年之前
distributional_q_tf_model.py 56878221ed [RLlib] Redo: Make TFModelV2 fully modular like TorchModelV2 (soft-deprecate register_variables, unify var names wrt torch). (#13363) 3 年之前
dqn.py b10d5533be [RLlib] Issue 20920 (partial solution): contrib/MADDPG + pettingzoo coop-pong-v4 not working. (#21452) 2 年之前
dqn_tf_policy.py 2d24ef0d32 [RLlib] Add all simple learning tests as `framework=tf2`. (#19273) 3 年之前
dqn_torch_model.py d553d4da6c [RLlib] DQN (Rainbow): Fix torch noisy layer support and loss (#16716) 3 年之前
dqn_torch_policy.py cf21c634a3 [RLlib] Fix deprecated warning for torch_ops.py (soft-replaced by torch_utils.py). (#19982) 3 年之前
learner_thread.py 0b308719f8 [RLlib; Docs overhaul] Docstring cleanup: rllib/utils (#19829) 3 年之前
r2d2.py b10d5533be [RLlib] Issue 20920 (partial solution): contrib/MADDPG + pettingzoo coop-pong-v4 not working. (#21452) 2 年之前
r2d2_tf_policy.py 3d2e27485b [RLlib] Trainer sub-class DQN/SimpleQ/APEX-DQN/R2D2 (instead of using `build_trainer`). (#20633) 2 年之前
r2d2_torch_policy.py 3d2e27485b [RLlib] Trainer sub-class DQN/SimpleQ/APEX-DQN/R2D2 (instead of using `build_trainer`). (#20633) 2 年之前
simple_q.py d5bfb7b7da [RLlib] Preparatory PR for multi-agent multi-GPU learner (alpha-star style) #03 (#21652) 2 年之前
simple_q_tf_policy.py 2317c693cf [RLlib] Use SampleBrach instead of input dict whenever possible (#20746) 2 年之前
simple_q_torch_policy.py 3d2e27485b [RLlib] Trainer sub-class DQN/SimpleQ/APEX-DQN/R2D2 (instead of using `build_trainer`). (#20633) 2 年之前

README.md

Deep Q Networks (DQN)

Code in this package is adapted from https://github.com/openai/baselines/tree/master/baselines/deepq.

Overview

DQN is a model-free off-policy RL algorithm and one of the first deep RL algorithms developed. DQN proposes using a neural network as a function approximator for the Q-function in Q-learning. The agent aims to minimize the L2 norm between the Q-value predictions and the Q-value targets, which is computed as 1-step TD. The paper proposes two important concepts, a target network and an experience replay buffer. The target network is a copy of the main Q network and is used to compute Q-value targets for loss-function calculations. To stabilize training, the target network lags slightly behind the main Q-network. Meanwhile, the experience replay stores all data encountered by the agent during training and is uniformly sampled from to generate gradient updates for the Q-value network.

Supported DQN Algorithms

Double DQN - As opposed to learning one Q network in vanilla DQN, Double DQN proposes learning two Q networks akin to double Q-learning. As a solution, Double DQN aims to solve the issue of vanilla DQN's overly-optimistic Q-values, which limits performance.

Dueling DQN - Dueling DQN proposes splitting learning a Q-value function approximator into learning two networks: a value and advantage approximator.

Distributional DQN - Usually, the Q network outputs the predicted Q-value of a state-action pair. Distributional DQN takes this further by predicting the distribution of Q-values (e.g. mean and std of a normal distribution) of a state-action pair. Doing this captures uncertainty of the Q-value and can improve the performance of DQN algorithms.

APEX-DQN - Standard DQN algorithms propose using a experience replay buffer to sample data uniformly and compute gradients from the sampled data. APEX introduces the notion of weighted replay data, where elements in the replay buffer are more or less likely to be sampled depending on the TD-error.

Rainbow - Rainbow DQN, as the word Rainbow suggests, aggregates the many improvements discovered in research to improve DQN performance. This includes a multi-step distributional loss (extended from Distributional DQN), prioritized replay (inspired from APEX-DQN), double Q-networks (inspired from Double DQN), and dueling networks (inspired from Dueling DQN).

Documentation & Implementation:

1) Vanilla DQN (DQN).

**[Detailed Documentation](https://docs.ray.io/en/master/rllib-algorithms.html#dqn)**

**[Implementation](https://github.com/ray-project/ray/blob/master/rllib/agents/dqn/simple_q.py)**

2) Double DQN.

**[Detailed Documentation](https://docs.ray.io/en/master/rllib-algorithms.html#dqn)**

**[Implementation](https://github.com/ray-project/ray/blob/master/rllib/agents/dqn/dqn.py)**

3) Dueling DQN

**[Detailed Documentation](https://docs.ray.io/en/master/rllib-algorithms.html#dqn)**

**[Implementation](https://github.com/ray-project/ray/blob/master/rllib/agents/dqn/dqn.py)**

3) Distributional DQN

**[Detailed Documentation](https://docs.ray.io/en/master/rllib-algorithms.html#dqn)**

**[Implementation](https://github.com/ray-project/ray/blob/master/rllib/agents/dqn/dqn.py)**

4) APEX DQN

**[Detailed Documentation](https://docs.ray.io/en/master/rllib-algorithms.html#dqn)**

**[Implementation](https://github.com/ray-project/ray/blob/master/rllib/agents/dqn/apex.py)**

5) Rainbow DQN

**[Detailed Documentation](https://docs.ray.io/en/master/rllib-algorithms.html#dqn)**

**[Implementation](https://github.com/ray-project/ray/blob/master/rllib/agents/dqn/dqn.py)**