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
f6acf786
Commit
f6acf786
authored
Jul 22, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
multiple RL stats
parent
b61d0722
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
8 deletions
+11
-8
README.md
README.md
+5
-5
tensorpack/RL/envbase.py
tensorpack/RL/envbase.py
+6
-3
No files found.
README.md
View file @
f6acf786
...
@@ -5,14 +5,14 @@ Still in development, but usable.
...
@@ -5,14 +5,14 @@ Still in development, but usable.
See some interesting
[
examples
](
https://github.com/ppwwyyxx/tensorpack/tree/master/examples
)
to learn about the framework:
See some interesting
[
examples
](
https://github.com/ppwwyyxx/tensorpack/tree/master/examples
)
to learn about the framework:
+
[
DoReFa-Net:
low bitwidth CNN
](
https://github.com/ppwwyyxx/tensorpack/tree/master/
examples/DoReFa-Net
)
+
[
DoReFa-Net:
training binary / low bitwidth CNN
](
examples/DoReFa-Net
)
+
[
Double-DQN for playing Atari games
](
https://github.com/ppwwyyxx/tensorpack/tree/master/
examples/Atari2600
)
+
[
Double-DQN for playing Atari games
](
examples/Atari2600
)
+
[
ResNet for Cifar10 classification
](
https://github.com/ppwwyyxx/tensorpack/tree/master/
examples/ResNet
)
+
[
ResNet for Cifar10 classification
](
examples/ResNet
)
+
[
char-rnn language model
](
https://github.com/ppwwyyxx/tensorpack/tree/master/
examples/char-rnn
)
+
[
char-rnn language model
](
examples/char-rnn
)
## Features:
## Features:
Focused on modularity. Just have to define the three components
in
training:
Focused on modularity. Just have to define the three components
to start a
training:
1.
The model, or the graph. Define the graph as well as its inputs and outputs.
`models/`
has some scoped abstraction of common models.
1.
The model, or the graph. Define the graph as well as its inputs and outputs.
`models/`
has some scoped abstraction of common models.
...
...
tensorpack/RL/envbase.py
View file @
f6acf786
...
@@ -51,16 +51,19 @@ class RLEnvironment(object):
...
@@ -51,16 +51,19 @@ class RLEnvironment(object):
def
play_one_episode
(
self
,
func
,
stat
=
'score'
):
def
play_one_episode
(
self
,
func
,
stat
=
'score'
):
""" play one episode for eval.
""" play one episode for eval.
:param func: call with the state and return an action
:param func: call with the state and return an action
:returns: the score of this episode
:param stat: a key or list of keys in stats
:returns: the stat(s) after running this episode
"""
"""
if
not
isinstance
(
stat
,
list
):
stat
=
[
stat
]
while
True
:
while
True
:
s
=
self
.
current_state
()
s
=
self
.
current_state
()
act
=
func
(
s
)
act
=
func
(
s
)
r
,
isOver
=
self
.
action
(
act
)
r
,
isOver
=
self
.
action
(
act
)
if
isOver
:
if
isOver
:
s
=
self
.
stats
[
stat
]
s
=
[
self
.
stats
[
k
]
for
k
in
stat
]
self
.
reset_stat
()
self
.
reset_stat
()
return
s
return
s
if
len
(
s
)
>
1
else
s
[
0
]
class
ActionSpace
(
object
):
class
ActionSpace
(
object
):
def
__init__
(
self
):
def
__init__
(
self
):
...
...
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