> For the complete documentation index, see [llms.txt](https://hujian.gitbook.io/deep-reinforcement-learning/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://hujian.gitbook.io/deep-reinforcement-learning/fang-fa/ment-te-zu-ma-de-fu-chou/ape-x.md).

# Ape-X

> [DISTRIBUTED PRIORITIZED EXPERIENCE REPLAY](https://arxiv.org/abs/1803.00933)

我们提出了一种用于大规模深度强化学习的分布式架构，使代理能够从数量级上有效地学习比以前更多的数据。 该算法将行为与学习分离：通过根据共享神经网络选择动作，actor与他们自己的环境实例交互，并在共享体验重放记忆中累积所得到的体验; 学习者重放经验样本并更新神经网络。 该体系结构依赖于优先级经验重放，仅针对参与者生成的最重要数据。 我们的架构大大改善了Arcade学习环境的最新技术水平，在壁钟培训时间的一小部分内实现了更好的最终性能。

## 方法

![](/files/-Larl4iaKqx6YRpmwcvf)

原则上，actor和learner可以分布在多个worker中。在我们的实验中，数百名参与者在处理器上运行以生成数据，一名学习者在处理器上运行以采样最有用的样本(图1 )。actor和learner的伪代码在算法1和2中显示。更新后的网络参数会定期从学习者处传达给参与者。

![](/files/-Larl7corrmGMiHVbFT9)

与共享梯度相比，共享经验具有一定的优势。 低延迟通信并不像分布式SGD那么重要，因为经验数据比梯度过时更慢，只要学习算法对off-policy数据具有鲁棒性。 在整个系统中，我们通过将所有通信与集中式重放进行批处理来利用这一点，以一定的延迟为代价提高效率和吞吐量。 通过这种方法，参与者和学习者甚至可以在不限制性能的情况下在不同的数据中心运行。

最后，通过学习off-policy，我们可以进一步利用Ape-X整合来自许多分布式参与者的数据的能力，为不同的参与者提供不同的策略，扩大他们共同遇到的体验的多样性。正如我们将在结果中看到的，这足以在困难的勘探问题上取得进展。

### APE-X DQN

$$
l\_{t}(\boldsymbol{\theta})=\frac{1}{2}\left(G\_{t}-q\left(S\_{t}, A\_{t}, \boldsymbol{\theta}\right)\right)^{2}
$$

![](/files/-LaroECv4Cw8tornCXEj)

### APE-X DPG

$$
l\_{t}(\psi)=\frac{1}{2}\left(G\_{t}-q\left(S\_{t}, A\_{t}, \psi\right)\right)^{2}
$$

![](/files/-LarpXNeyLw_ltoD9Iay)

## 实验

![](/files/-LarpvnxtvNX-NyIIrR7)

![](/files/-LarpnyvnXNXbdYBFkx9)

![](/files/-LarpyAy4wgrc43Ni0zv)

![](/files/-Larq-YRdQRhoRM4zJig)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://hujian.gitbook.io/deep-reinforcement-learning/fang-fa/ment-te-zu-ma-de-fu-chou/ape-x.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
