Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
seminar-breakout
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Shashank Suhas
seminar-breakout
Commits
208de18c
Commit
208de18c
authored
May 29, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
use stat in DQN instead of reward
parent
5fd47e6d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
examples/Atari2600/DQN.py
examples/Atari2600/DQN.py
+3
-3
No files found.
examples/Atari2600/DQN.py
View file @
208de18c
...
@@ -136,7 +136,6 @@ def current_predictor(state):
...
@@ -136,7 +136,6 @@ def current_predictor(state):
return
pred
[
0
]
return
pred
[
0
]
def
play_one_episode
(
player
,
func
,
verbose
=
False
):
def
play_one_episode
(
player
,
func
,
verbose
=
False
):
tot_reward
=
0
while
True
:
while
True
:
s
=
player
.
current_state
()
s
=
player
.
current_state
()
outputs
=
func
([[
s
]])
outputs
=
func
([[
s
]])
...
@@ -149,9 +148,10 @@ def play_one_episode(player, func, verbose=False):
...
@@ -149,9 +148,10 @@ def play_one_episode(player, func, verbose=False):
if
verbose
:
if
verbose
:
print
(
act
)
print
(
act
)
reward
,
isOver
=
player
.
action
(
act
)
reward
,
isOver
=
player
.
action
(
act
)
tot_reward
+=
reward
if
isOver
:
if
isOver
:
return
tot_reward
sc
=
player
.
stats
[
'score'
][
0
]
player
.
reset_stat
()
return
sc
def
play_model
(
model_path
):
def
play_model
(
model_path
):
player
=
PreventStuckPlayer
(
HistoryFramePlayer
(
get_player
(
0.01
),
FRAME_HISTORY
),
30
,
1
)
player
=
PreventStuckPlayer
(
HistoryFramePlayer
(
get_player
(
0.01
),
FRAME_HISTORY
),
30
,
1
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment