Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
PaddlePaddle
models
提交
ef687124
M
models
项目概览
PaddlePaddle
/
models
大约 1 年 前同步成功
通知
222
Star
6828
Fork
2962
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
602
列表
看板
标记
里程碑
合并请求
255
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
models
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
602
Issue
602
列表
看板
标记
里程碑
合并请求
255
合并请求
255
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
ef687124
编写于
8月 29, 2018
作者:
R
robot
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Compatible with python3 is supported
上级
40b3e11d
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
14 addition
and
14 deletion
+14
-14
fluid/DeepQNetwork/DQN_agent.py
fluid/DeepQNetwork/DQN_agent.py
+4
-4
fluid/DeepQNetwork/DoubleDQN_agent.py
fluid/DeepQNetwork/DoubleDQN_agent.py
+4
-4
fluid/DeepQNetwork/DuelingDQN_agent.py
fluid/DeepQNetwork/DuelingDQN_agent.py
+4
-4
fluid/DeepQNetwork/atari.py
fluid/DeepQNetwork/atari.py
+1
-1
fluid/DeepQNetwork/train.py
fluid/DeepQNetwork/train.py
+1
-1
未找到文件。
fluid/DeepQNetwork/DQN_agent.py
浏览文件 @
ef687124
...
@@ -135,10 +135,10 @@ class DQNModel(object):
...
@@ -135,10 +135,10 @@ class DQNModel(object):
def
_build_sync_target_network
(
self
):
def
_build_sync_target_network
(
self
):
vars
=
list
(
fluid
.
default_main_program
().
list_vars
())
vars
=
list
(
fluid
.
default_main_program
().
list_vars
())
policy_vars
=
filter
(
policy_vars
=
list
(
filter
(
lambda
x
:
'GRAD'
not
in
x
.
name
and
'policy'
in
x
.
name
,
vars
)
lambda
x
:
'GRAD'
not
in
x
.
name
and
'policy'
in
x
.
name
,
vars
)
)
target_vars
=
filter
(
target_vars
=
list
(
filter
(
lambda
x
:
'GRAD'
not
in
x
.
name
and
'target'
in
x
.
name
,
vars
)
lambda
x
:
'GRAD'
not
in
x
.
name
and
'target'
in
x
.
name
,
vars
)
)
policy_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
policy_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
target_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
target_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
...
...
fluid/DeepQNetwork/DoubleDQN_agent.py
浏览文件 @
ef687124
...
@@ -142,10 +142,10 @@ class DoubleDQNModel(object):
...
@@ -142,10 +142,10 @@ class DoubleDQNModel(object):
def
_build_sync_target_network
(
self
):
def
_build_sync_target_network
(
self
):
vars
=
list
(
fluid
.
default_main_program
().
list_vars
())
vars
=
list
(
fluid
.
default_main_program
().
list_vars
())
policy_vars
=
filter
(
policy_vars
=
list
(
filter
(
lambda
x
:
'GRAD'
not
in
x
.
name
and
'policy'
in
x
.
name
,
vars
)
lambda
x
:
'GRAD'
not
in
x
.
name
and
'policy'
in
x
.
name
,
vars
)
)
target_vars
=
filter
(
target_vars
=
list
(
filter
(
lambda
x
:
'GRAD'
not
in
x
.
name
and
'target'
in
x
.
name
,
vars
)
lambda
x
:
'GRAD'
not
in
x
.
name
and
'target'
in
x
.
name
,
vars
)
)
policy_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
policy_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
target_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
target_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
...
...
fluid/DeepQNetwork/DuelingDQN_agent.py
浏览文件 @
ef687124
...
@@ -145,10 +145,10 @@ class DuelingDQNModel(object):
...
@@ -145,10 +145,10 @@ class DuelingDQNModel(object):
def
_build_sync_target_network
(
self
):
def
_build_sync_target_network
(
self
):
vars
=
list
(
fluid
.
default_main_program
().
list_vars
())
vars
=
list
(
fluid
.
default_main_program
().
list_vars
())
policy_vars
=
filter
(
policy_vars
=
list
(
filter
(
lambda
x
:
'GRAD'
not
in
x
.
name
and
'policy'
in
x
.
name
,
vars
)
lambda
x
:
'GRAD'
not
in
x
.
name
and
'policy'
in
x
.
name
,
vars
)
)
target_vars
=
filter
(
target_vars
=
list
(
filter
(
lambda
x
:
'GRAD'
not
in
x
.
name
and
'target'
in
x
.
name
,
vars
)
lambda
x
:
'GRAD'
not
in
x
.
name
and
'target'
in
x
.
name
,
vars
)
)
policy_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
policy_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
target_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
target_vars
.
sort
(
key
=
lambda
x
:
x
.
name
)
...
...
fluid/DeepQNetwork/atari.py
浏览文件 @
ef687124
...
@@ -55,7 +55,7 @@ class AtariPlayer(gym.Env):
...
@@ -55,7 +55,7 @@ class AtariPlayer(gym.Env):
try
:
try
:
ALEInterface
.
setLoggerMode
(
ALEInterface
.
Logger
.
Error
)
ALEInterface
.
setLoggerMode
(
ALEInterface
.
Logger
.
Error
)
except
AttributeError
:
except
AttributeError
:
print
"You're not using latest ALE"
print
(
"You're not using latest ALE"
)
# avoid simulator bugs: https://github.com/mgbellemare/Arcade-Learning-Environment/issues/86
# avoid simulator bugs: https://github.com/mgbellemare/Arcade-Learning-Environment/issues/86
with
_ALE_LOCK
:
with
_ALE_LOCK
:
...
...
fluid/DeepQNetwork/train.py
浏览文件 @
ef687124
...
@@ -74,7 +74,7 @@ def get_player(rom, viz=False, train=False):
...
@@ -74,7 +74,7 @@ def get_player(rom, viz=False, train=False):
def
eval_agent
(
agent
,
env
):
def
eval_agent
(
agent
,
env
):
episode_reward
=
[]
episode_reward
=
[]
for
_
in
tqdm
(
x
range
(
30
),
desc
=
'eval agent'
):
for
_
in
tqdm
(
range
(
30
),
desc
=
'eval agent'
):
state
=
env
.
reset
()
state
=
env
.
reset
()
total_reward
=
0
total_reward
=
0
step
=
0
step
=
0
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录