Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
PARL
提交
d5a8d268
P
PARL
项目概览
PaddlePaddle
/
PARL
通知
67
Star
3
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
18
列表
看板
标记
里程碑
合并请求
3
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
P
PARL
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
18
Issue
18
列表
看板
标记
里程碑
合并请求
3
合并请求
3
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
d5a8d268
编写于
10月 29, 2019
作者:
L
LI Yunxiang
提交者:
Bo Zhou
10月 29, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update dqn lr_scheduler (#164)
上级
bb9b78b4
变更
2
隐藏空白更改
内联
并排
Showing
2 changed file
with
5 addition
and
3 deletion
+5
-3
examples/DQN/atari_agent.py
examples/DQN/atari_agent.py
+3
-2
examples/DQN/train.py
examples/DQN/train.py
+2
-1
未找到文件。
examples/DQN/atari_agent.py
浏览文件 @
d5a8d268
...
...
@@ -24,13 +24,14 @@ CONTEXT_LEN = 4
class
AtariAgent
(
parl
.
Agent
):
def
__init__
(
self
,
algorithm
,
act_dim
,
start_lr
,
total_step
):
def
__init__
(
self
,
algorithm
,
act_dim
,
start_lr
,
total_step
,
update_freq
):
super
(
AtariAgent
,
self
).
__init__
(
algorithm
)
assert
isinstance
(
act_dim
,
int
)
self
.
act_dim
=
act_dim
self
.
exploration
=
1.1
self
.
global_step
=
0
self
.
update_target_steps
=
10000
//
4
self
.
update_freq
=
update_freq
self
.
lr_scheduler
=
LinearDecayScheduler
(
start_lr
,
total_step
)
...
...
@@ -95,7 +96,7 @@ class AtariAgent(parl.Agent):
self
.
alg
.
sync_target
()
self
.
global_step
+=
1
lr
=
self
.
lr_scheduler
.
step
(
step_num
=
obs
.
shape
[
0
]
)
lr
=
self
.
lr_scheduler
.
step
(
step_num
=
self
.
update_freq
)
act
=
np
.
expand_dims
(
act
,
-
1
)
reward
=
np
.
clip
(
reward
,
-
1
,
1
)
...
...
examples/DQN/train.py
浏览文件 @
d5a8d268
...
...
@@ -101,7 +101,8 @@ def main():
algorithm
,
act_dim
=
act_dim
,
start_lr
=
LEARNING_RATE
,
total_step
=
args
.
train_total_steps
)
total_step
=
args
.
train_total_steps
,
update_freq
=
UPDATE_FREQ
)
with
tqdm
(
total
=
MEMORY_WARMUP_SIZE
,
desc
=
'[Replay Memory Warm Up]'
)
as
pbar
:
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录