Skip to content

Commit 31ee435

Browse files
committed
docs: 📝 update readme.md
1 parent 7e6bdca commit 31ee435

File tree

3 files changed

+36
-12
lines changed

3 files changed

+36
-12
lines changed

AsynchronousAdvantageActorCritic(A3C)/readme.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,12 @@ Deep Mind 提出的一种解决 Actor Critic 不收敛问题的算法,它会
1414

1515
---
1616

17-
## python 多线程无法占用:使用 multiprocessing 的包
17+
## python 多线程无法占用:使用 torch.multiprocessing 的包
1818

1919
- Python 由于全局锁 GIL 的存在,无法享受多线程带来的性能提升。
2020

2121
- multiprocessing 包采用子进程的技术避开了 GIL,使用 multiprocessing 可以进行多进程编程提高程序效率。
22+
- multiprocessing 使用`共享内存`进行进程中的通信
2223
- 模型并行:把模型拆分放到不同的设备进行训练
24+
- 数据并行:把数据切分,并复制到各个机器上,然后将所有结果按照某种算法 hebing
25+
- https://ptorch.com/news/176.html

DeepDeterministicPolicyGradient/model.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,9 @@ def learn(self):
146146
# 跟require_grad不同,require_grad=False的使用可以 #
147147
# 在训练过程中冻结网络参数 ,于此相同的还有with t.no_grad()#
148148
#################################################
149-
loss_actor.backward(retain_graph=True)
149+
150+
# loss_actor.backward(retain_graph=True) ?
151+
loss_actor.backward(retain_graph=False)
150152
self.optimizer_actor.step()
151153

152154
# TRAIN CRITIC

readme.md

Lines changed: 29 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -53,16 +53,6 @@ Fixed Q-target: `在神经网络中,Q 的值并不是互相独立的,所以
5353

5454
---
5555

56-
## DQN with Prioritized Experience Replay
57-
58-
在 DQN 中,我们有 Experience Replay,但是这是经验是随机抽取的,我们需要让好的、成功的记忆多多被学习到,所以我们在抽取经验的时候,就需要把这些记忆优先给网络学习,于是就有了`Prioritized`Experience Replay
59-
60-
## Dueling DQN
61-
62-
将 Q 值的计算分成状态值 state_value 和每个动作的值 advantage,可以获得更好的性能
63-
64-
---
65-
6656
## Policy Gradient
6757

6858
核心思想:让好的行为多被选择,坏的行为少被选择。<br>
@@ -77,12 +67,41 @@ Fixed Q-target: `在神经网络中,Q 的值并不是互相独立的,所以
7767

7868
---
7969

70+
# 2021-12-12
71+
72+
## Dueling DQN
73+
74+
将 Q 值的计算分成状态值 state_value 和每个动作的值 advantage,可以获得更好的性能
75+
76+
---
77+
78+
## DQN with Prioritized Experience Replay
79+
80+
在 DQN 中,我们有 Experience Replay,但是这是经验是随机抽取的,我们需要让好的、成功的记忆多多被学习到,所以我们在抽取经验的时候,就需要把这些记忆优先给网络学习,于是就有了`Prioritized`Experience Replay
81+
82+
---
83+
8084
## DDPG
8185

8286
![](DeepDeterministicPolicyGradient\principle.png)
8387

88+
- Exploration noise
89+
- Actor-Critic Achetecture
90+
- Fixed Q-Target
91+
- Policy Gradient
92+
- Experience Replay (OFF-POLICY)
93+
94+
## A3C
95+
96+
- A3C 里面有多个 agent 对网络进行异步更新,相关性较低
97+
- 不需要积累经验,占用内存少
98+
- on-policy 训练
99+
- 多线程异步,速度快
100+
84101
## Requirements
85102

103+
- numpy
104+
- tensorboardX
86105
- torch
87106
- gym
88107

0 commit comments

Comments
 (0)