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
817bb882
Commit
817bb882
authored
Apr 04, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update svhn performance
parent
2bc3a766
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
8 additions
and
9 deletions
+8
-9
examples/svhn_digit_convnet.py
examples/svhn_digit_convnet.py
+6
-7
tensorpack/dataflow/dataset/svhn.py
tensorpack/dataflow/dataset/svhn.py
+0
-1
tensorpack/models/model_desc.py
tensorpack/models/model_desc.py
+1
-1
tensorpack/train/base.py
tensorpack/train/base.py
+1
-0
No files found.
examples/svhn_digit_convnet.py
View file @
817bb882
...
@@ -20,7 +20,7 @@ from tensorpack.dataflow import imgaug
...
@@ -20,7 +20,7 @@ from tensorpack.dataflow import imgaug
"""
"""
SVHN convnet.
SVHN convnet.
About 3.0
%
validation error after
120 epoch. 2.7
%
after 30
0 epoch.
About 3.0
%
validation error after
70 epoch. 2.5
%
after 13
0 epoch.
"""
"""
class
Model
(
ModelDesc
):
class
Model
(
ModelDesc
):
...
@@ -34,17 +34,16 @@ class Model(ModelDesc):
...
@@ -34,17 +34,16 @@ class Model(ModelDesc):
image
=
image
/
128.0
-
1
image
=
image
/
128.0
-
1
nl
=
lambda
x
,
name
:
tf
.
abs
(
tf
.
tanh
(
x
),
name
=
name
)
l
=
Conv2D
(
'conv1'
,
image
,
24
,
5
,
padding
=
'VALID'
)
l
=
Conv2D
(
'conv1'
,
image
,
24
,
5
,
padding
=
'VALID'
,
nl
=
nl
)
l
=
MaxPooling
(
'pool1'
,
l
,
2
,
padding
=
'SAME'
)
l
=
MaxPooling
(
'pool1'
,
l
,
2
,
padding
=
'SAME'
)
l
=
Conv2D
(
'conv2'
,
l
,
32
,
3
,
nl
=
nl
,
padding
=
'VALID'
)
l
=
Conv2D
(
'conv2'
,
l
,
32
,
3
,
padding
=
'VALID'
)
l
=
Conv2D
(
'conv3'
,
l
,
32
,
3
,
nl
=
nl
,
padding
=
'VALID'
)
l
=
Conv2D
(
'conv3'
,
l
,
32
,
3
,
padding
=
'VALID'
)
l
=
MaxPooling
(
'pool2'
,
l
,
2
,
padding
=
'SAME'
)
l
=
MaxPooling
(
'pool2'
,
l
,
2
,
padding
=
'SAME'
)
l
=
Conv2D
(
'conv4'
,
l
,
64
,
3
,
nl
=
nl
,
padding
=
'VALID'
)
l
=
Conv2D
(
'conv4'
,
l
,
64
,
3
,
padding
=
'VALID'
)
l
=
tf
.
nn
.
dropout
(
l
,
keep_prob
)
l
=
tf
.
nn
.
dropout
(
l
,
keep_prob
)
l
=
FullyConnected
(
'fc0'
,
l
,
512
,
l
=
FullyConnected
(
'fc0'
,
l
,
512
,
b_init
=
tf
.
constant_initializer
(
0.1
)
,
nl
=
nl
)
b_init
=
tf
.
constant_initializer
(
0.1
))
# fc will have activation summary by default. disable for the output layer
# fc will have activation summary by default. disable for the output layer
logits
=
FullyConnected
(
'linear'
,
l
,
out_dim
=
10
,
summary_activation
=
False
,
logits
=
FullyConnected
(
'linear'
,
l
,
out_dim
=
10
,
summary_activation
=
False
,
nl
=
tf
.
identity
)
nl
=
tf
.
identity
)
...
...
tensorpack/dataflow/dataset/svhn.py
View file @
817bb882
...
@@ -49,7 +49,6 @@ http://ufldl.stanford.edu/housenumbers/".format(filename)
...
@@ -49,7 +49,6 @@ http://ufldl.stanford.edu/housenumbers/".format(filename)
self
.
Y
[
self
.
Y
==
10
]
=
0
self
.
Y
[
self
.
Y
==
10
]
=
0
SVHNDigit
.
Cache
[
name
]
=
(
self
.
X
,
self
.
Y
)
SVHNDigit
.
Cache
[
name
]
=
(
self
.
X
,
self
.
Y
)
def
size
(
self
):
def
size
(
self
):
return
self
.
X
.
shape
[
0
]
return
self
.
X
.
shape
[
0
]
...
...
tensorpack/models/model_desc.py
View file @
817bb882
...
@@ -73,4 +73,4 @@ class ModelDesc(object):
...
@@ -73,4 +73,4 @@ class ModelDesc(object):
def
get_gradient_processor
(
self
):
def
get_gradient_processor
(
self
):
""" Return a list of GradientProcessor. They will be executed in order"""
""" Return a list of GradientProcessor. They will be executed in order"""
return
[
CheckGradient
(),
SummaryGradient
()]
return
[
CheckGradient
()
]
#
, SummaryGradient()]
tensorpack/train/base.py
View file @
817bb882
...
@@ -64,6 +64,7 @@ class Trainer(object):
...
@@ -64,6 +64,7 @@ class Trainer(object):
def
main_loop
(
self
):
def
main_loop
(
self
):
# some final operations that might modify the graph
# some final operations that might modify the graph
logger
.
info
(
"Preparing for training..."
)
self
.
_init_summary
()
self
.
_init_summary
()
get_global_step_var
()
get_global_step_var
()
callbacks
=
self
.
config
.
callbacks
callbacks
=
self
.
config
.
callbacks
...
...
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