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
5f98e6ca
Commit
5f98e6ca
authored
Jun 08, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix param callback gbu
parent
7da1d899
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
2 deletions
+6
-2
examples/Atari2600/DQN.py
examples/Atari2600/DQN.py
+3
-1
examples/ResNet/cifar10-resnet.py
examples/ResNet/cifar10-resnet.py
+1
-1
tensorpack/callbacks/param.py
tensorpack/callbacks/param.py
+2
-0
No files found.
examples/Atari2600/DQN.py
View file @
5f98e6ca
...
@@ -138,6 +138,7 @@ class Model(ModelDesc):
...
@@ -138,6 +138,7 @@ class Model(ModelDesc):
def
predictor
(
self
,
state
):
def
predictor
(
self
,
state
):
return
self
.
predict_value
.
eval
(
feed_dict
=
{
'state:0'
:
[
state
]})[
0
]
return
self
.
predict_value
.
eval
(
feed_dict
=
{
'state:0'
:
[
state
]})[
0
]
#return self.predict_value.eval(feed_dict={'input_deque:0': [state]})[0]
def
get_config
():
def
get_config
():
basename
=
os
.
path
.
basename
(
__file__
)
basename
=
os
.
path
.
basename
(
__file__
)
...
@@ -174,7 +175,7 @@ def get_config():
...
@@ -174,7 +175,7 @@ def get_config():
PeriodicCallback
(
Evaluator
(
EVAL_EPISODE
,
'fct/output:0'
),
2
),
PeriodicCallback
(
Evaluator
(
EVAL_EPISODE
,
'fct/output:0'
),
2
),
]),
]),
# save memory for multiprocess evaluator
# save memory for multiprocess evaluator
session_config
=
get_default_sess_config
(
0.
3
),
session_config
=
get_default_sess_config
(
0.
6
),
model
=
M
,
model
=
M
,
step_per_epoch
=
STEP_PER_EPOCH
,
step_per_epoch
=
STEP_PER_EPOCH
,
)
)
...
@@ -208,4 +209,5 @@ if __name__ == '__main__':
...
@@ -208,4 +209,5 @@ if __name__ == '__main__':
if
args
.
load
:
if
args
.
load
:
config
.
session_init
=
SaverRestore
(
args
.
load
)
config
.
session_init
=
SaverRestore
(
args
.
load
)
SimpleTrainer
(
config
)
.
train
()
SimpleTrainer
(
config
)
.
train
()
#QueueInputTrainer(config).train()
examples/ResNet/cifar10-resnet.py
View file @
5f98e6ca
...
@@ -3,9 +3,9 @@
...
@@ -3,9 +3,9 @@
# File: cifar10-resnet.py
# File: cifar10-resnet.py
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
import
numpy
as
np
import
tensorflow
as
tf
import
tensorflow
as
tf
import
argparse
import
argparse
import
numpy
as
np
import
os
import
os
from
tensorpack.train
import
TrainConfig
,
QueueInputTrainer
from
tensorpack.train
import
TrainConfig
,
QueueInputTrainer
...
...
tensorpack/callbacks/param.py
View file @
5f98e6ca
...
@@ -7,6 +7,7 @@ import tensorflow as tf
...
@@ -7,6 +7,7 @@ import tensorflow as tf
from
abc
import
abstractmethod
,
ABCMeta
,
abstractproperty
from
abc
import
abstractmethod
,
ABCMeta
,
abstractproperty
import
operator
import
operator
import
six
import
six
import
os
from
.base
import
Callback
from
.base
import
Callback
from
..utils
import
logger
from
..utils
import
logger
...
@@ -29,6 +30,7 @@ class HyperParam(object):
...
@@ -29,6 +30,7 @@ class HyperParam(object):
""" define how the value of the param will be set"""
""" define how the value of the param will be set"""
pass
pass
@
property
def
readable_name
(
self
):
def
readable_name
(
self
):
""" A name to display"""
""" A name to display"""
return
self
.
_readable_name
return
self
.
_readable_name
...
...
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