File tree 3 files changed +36
-12
lines changed
AsynchronousAdvantageActorCritic(A3C)
DeepDeterministicPolicyGradient 3 files changed +36
-12
lines changed Original file line number Diff line number Diff line change @@ -14,9 +14,12 @@ Deep Mind 提出的一种解决 Actor Critic 不收敛问题的算法,它会
14
14
15
15
---
16
16
17
- ## python 多线程无法占用:使用 multiprocessing 的包
17
+ ## python 多线程无法占用:使用 torch. multiprocessing 的包
18
18
19
19
- Python 由于全局锁 GIL 的存在,无法享受多线程带来的性能提升。
20
20
21
21
- multiprocessing 包采用子进程的技术避开了 GIL,使用 multiprocessing 可以进行多进程编程提高程序效率。
22
+ - multiprocessing 使用` 共享内存 ` 进行进程中的通信
22
23
- 模型并行:把模型拆分放到不同的设备进行训练
24
+ - 数据并行:把数据切分,并复制到各个机器上,然后将所有结果按照某种算法 hebing
25
+ - https://ptorch.com/news/176.html
Original file line number Diff line number Diff line change @@ -146,7 +146,9 @@ def learn(self):
146
146
# 跟require_grad不同,require_grad=False的使用可以 #
147
147
# 在训练过程中冻结网络参数 ,于此相同的还有with t.no_grad()#
148
148
#################################################
149
- loss_actor .backward (retain_graph = True )
149
+
150
+ # loss_actor.backward(retain_graph=True) ?
151
+ loss_actor .backward (retain_graph = False )
150
152
self .optimizer_actor .step ()
151
153
152
154
# TRAIN CRITIC
Original file line number Diff line number Diff line change @@ -53,16 +53,6 @@ Fixed Q-target: `在神经网络中,Q 的值并不是互相独立的,所以
53
53
54
54
---
55
55
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
-
66
56
## Policy Gradient
67
57
68
58
核心思想:让好的行为多被选择,坏的行为少被选择。<br >
@@ -77,12 +67,41 @@ Fixed Q-target: `在神经网络中,Q 的值并不是互相独立的,所以
77
67
78
68
---
79
69
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
+
80
84
## DDPG
81
85
82
86
![ ] ( DeepDeterministicPolicyGradient\principle.png )
83
87
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
+
84
101
## Requirements
85
102
103
+ - numpy
104
+ - tensorboardX
86
105
- torch
87
106
- gym
88
107
You can’t perform that action at this time.
0 commit comments