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
c9e03b73
Commit
c9e03b73
authored
Jul 16, 2019
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add MODEL_VARIABLES in SyncBN (fix #1270)
parent
610a8b9b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
0 deletions
+4
-0
tensorpack/models/batch_norm.py
tensorpack/models/batch_norm.py
+4
-0
No files found.
tensorpack/models/batch_norm.py
View file @
c9e03b73
...
@@ -37,6 +37,10 @@ def get_bn_variables(n_out, use_scale, use_bias, beta_init, gamma_init):
...
@@ -37,6 +37,10 @@ def get_bn_variables(n_out, use_scale, use_bias, beta_init, gamma_init):
initializer
=
tf
.
constant_initializer
(),
trainable
=
False
)
initializer
=
tf
.
constant_initializer
(),
trainable
=
False
)
moving_var
=
tf
.
get_variable
(
'variance/EMA'
,
[
n_out
],
moving_var
=
tf
.
get_variable
(
'variance/EMA'
,
[
n_out
],
initializer
=
tf
.
constant_initializer
(
1.0
),
trainable
=
False
)
initializer
=
tf
.
constant_initializer
(
1.0
),
trainable
=
False
)
if
get_current_tower_context
()
.
is_main_training_tower
:
for
v
in
[
moving_mean
,
moving_var
]:
tf
.
add_to_collection
(
tf
.
GraphKeys
.
MODEL_VARIABLES
,
v
)
return
beta
,
gamma
,
moving_mean
,
moving_var
return
beta
,
gamma
,
moving_mean
,
moving_var
...
...
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