Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ModelZoo
ResNet50_tensorflow
Commits
2c9a1100
Commit
2c9a1100
authored
Feb 02, 2018
by
Dan O'Shea
Browse files
Restoring old do_bias=False logic, keeping trainable option
parent
0c1d2961
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
12 deletions
+9
-12
research/lfads/utils.py
research/lfads/utils.py
+9
-12
No files found.
research/lfads/utils.py
View file @
2c9a1100
...
@@ -148,24 +148,21 @@ def init_linear(in_size, out_size, do_bias=True, mat_init_value=None,
...
@@ -148,24 +148,21 @@ def init_linear(in_size, out_size, do_bias=True, mat_init_value=None,
else
:
else
:
w
=
tf
.
get_variable
(
wname
,
[
in_size
,
out_size
],
initializer
=
mat_init
,
w
=
tf
.
get_variable
(
wname
,
[
in_size
,
out_size
],
initializer
=
mat_init
,
collections
=
w_collections
,
trainable
=
trainable
)
collections
=
w_collections
,
trainable
=
trainable
)
b
=
None
b_collections
=
[
tf
.
GraphKeys
.
GLOBAL_VARIABLES
]
if
collections
:
b_collections
+=
collections
bname
=
(
name
+
"/b"
)
if
name
else
"/b"
if
do_bias
:
if
do_bias
:
b_collections
=
[
tf
.
GraphKeys
.
GLOBAL_VARIABLES
]
if
collections
:
b_collections
+=
collections
bname
=
(
name
+
"/b"
)
if
name
else
"/b"
if
bias_init_value
is
None
:
if
bias_init_value
is
None
:
b
=
tf
.
get_variable
(
bname
,
[
1
,
out_size
],
b
=
tf
.
get_variable
(
bname
,
[
1
,
out_size
],
initializer
=
tf
.
zeros_initializer
(),
initializer
=
tf
.
zeros_initializer
(),
collections
=
b_collections
,
trainable
=
trainable
)
collections
=
b_collections
,
trainable
=
trainable
)
else
:
else
:
b
=
tf
.
Variable
(
bias_init_value
,
name
=
bname
,
b
=
tf
.
Variable
(
bias_init_value
,
name
=
bname
,
collections
=
b_collections
,
trainable
=
trainable
)
collections
=
b_collections
,
else
:
trainable
=
trainable
)
# construct a non-learnable vector of zeros as the bias
b
=
tf
.
get_variable
(
bname
,
[
1
,
out_size
],
initializer
=
tf
.
zeros_initializer
(),
collections
=
b_collections
,
trainable
=
False
)
return
(
w
,
b
)
return
(
w
,
b
)
...
...
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