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
087af16e
You need to sign in or sign up before continuing.
Commit
087af16e
authored
Feb 18, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fc with different init
parent
a98f005a
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
9 additions
and
12 deletions
+9
-12
example_cifar10.py
example_cifar10.py
+2
-5
example_mnist.py
example_mnist.py
+1
-1
tensorpack/models/fc.py
tensorpack/models/fc.py
+2
-2
usercustomize.py
usercustomize.py
+4
-4
No files found.
example_cifar10.py
View file @
087af16e
...
@@ -60,15 +60,12 @@ class Model(ModelDesc):
...
@@ -60,15 +60,12 @@ class Model(ModelDesc):
l
=
BatchNorm
(
'bn3'
,
l
,
is_training
)
l
=
BatchNorm
(
'bn3'
,
l
,
is_training
)
l
=
tf
.
nn
.
relu
(
l
)
l
=
tf
.
nn
.
relu
(
l
)
l
=
FullyConnected
(
'fc0'
,
l
,
512
,
l
=
FullyConnected
(
'fc0'
,
l
,
512
,
W_init
=
tf
.
truncated_normal_initializer
(
stddev
=
0.04
),
b_init
=
tf
.
constant_initializer
(
0.1
))
b_init
=
tf
.
constant_initializer
(
0.1
))
l
=
FullyConnected
(
'fc1'
,
l
,
out_dim
=
512
,
l
=
FullyConnected
(
'fc1'
,
l
,
out_dim
=
512
,
W_init
=
tf
.
truncated_normal_initializer
(
stddev
=
0.04
),
b_init
=
tf
.
constant_initializer
(
0.1
))
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
)
W_init
=
tf
.
truncated_normal_initializer
(
stddev
=
1.0
/
192
))
prob
=
tf
.
nn
.
softmax
(
logits
,
name
=
'output'
)
prob
=
tf
.
nn
.
softmax
(
logits
,
name
=
'output'
)
y
=
one_hot
(
label
,
10
)
y
=
one_hot
(
label
,
10
)
...
@@ -134,7 +131,7 @@ def get_config():
...
@@ -134,7 +131,7 @@ def get_config():
dataset
=
dataset_train
,
dataset
=
dataset_train
,
optimizer
=
tf
.
train
.
AdamOptimizer
(
lr
),
optimizer
=
tf
.
train
.
AdamOptimizer
(
lr
),
callbacks
=
Callbacks
([
callbacks
=
Callbacks
([
SummaryWriter
(
print_tag
=
[
'train_cost'
,
'train_error'
]
),
SummaryWriter
(),
PeriodicSaver
(),
PeriodicSaver
(),
ValidationError
(
dataset_test
,
prefix
=
'test'
),
ValidationError
(
dataset_test
,
prefix
=
'test'
),
]),
]),
...
...
example_mnist.py
View file @
087af16e
...
@@ -20,7 +20,7 @@ from tensorpack.dataflow import *
...
@@ -20,7 +20,7 @@ from tensorpack.dataflow import *
"""
"""
MNIST ConvNet example.
MNIST ConvNet example.
99.3
3
%
test
accuracy after 50 epochs.
99.3
%
validation
accuracy after 50 epochs.
"""
"""
BATCH_SIZE
=
128
BATCH_SIZE
=
128
...
...
tensorpack/models/fc.py
View file @
087af16e
...
@@ -17,8 +17,8 @@ def FullyConnected(x, out_dim, W_init=None, b_init=None, nl=tf.nn.relu):
...
@@ -17,8 +17,8 @@ def FullyConnected(x, out_dim, W_init=None, b_init=None, nl=tf.nn.relu):
in_dim
=
x
.
get_shape
()
.
as_list
()[
1
]
in_dim
=
x
.
get_shape
()
.
as_list
()[
1
]
if
W_init
is
None
:
if
W_init
is
None
:
W_init
=
tf
.
truncated_normal_initializer
(
stddev
=
1
/
math
.
sqrt
(
float
(
in_dim
)))
#
W_init = tf.truncated_normal_initializer(stddev=1 / math.sqrt(float(in_dim)))
#
W_init = tf.uniform_unit_scaling_initializer()
W_init
=
tf
.
uniform_unit_scaling_initializer
()
if
b_init
is
None
:
if
b_init
is
None
:
b_init
=
tf
.
constant_initializer
(
0.0
)
b_init
=
tf
.
constant_initializer
(
0.0
)
...
...
usercustomize.py
View file @
087af16e
...
@@ -4,7 +4,7 @@
...
@@ -4,7 +4,7 @@
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
# Author: Yuxin Wu <ppwwyyxx@gmail.com>
# use user-space protobuf
# use user-space protobuf
#
import sys, os
import
sys
,
os
#
site = os.path.join(os.environ['HOME'],
site
=
os
.
path
.
join
(
os
.
environ
[
'HOME'
],
#
'.local/lib/python2.7/site-packages')
'.local/lib/python2.7/site-packages'
)
#
sys.path.insert(0, site)
sys
.
path
.
insert
(
0
,
site
)
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