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
9aa390c7
Commit
9aa390c7
authored
May 22, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add rms for param summary
parent
9319b978
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
tensorpack/tfutils/summary.py
tensorpack/tfutils/summary.py
+5
-1
No files found.
tensorpack/tfutils/summary.py
View file @
9aa390c7
...
@@ -40,7 +40,7 @@ def add_param_summary(summary_lists):
...
@@ -40,7 +40,7 @@ def add_param_summary(summary_lists):
Add summary for all trainable variables matching the regex
Add summary for all trainable variables matching the regex
:param summary_lists: list of (regex, [list of action to perform]).
:param summary_lists: list of (regex, [list of action to perform]).
Action can be 'mean', 'scalar', 'histogram', 'sparsity'
.
Action can be 'mean', 'scalar', 'histogram', 'sparsity'
, 'rms'
"""
"""
def
perform
(
var
,
action
):
def
perform
(
var
,
action
):
ndim
=
var
.
get_shape
()
.
ndims
ndim
=
var
.
get_shape
()
.
ndims
...
@@ -59,6 +59,10 @@ def add_param_summary(summary_lists):
...
@@ -59,6 +59,10 @@ def add_param_summary(summary_lists):
if
action
==
'mean'
:
if
action
==
'mean'
:
tf
.
scalar_summary
(
name
+
'/mean'
,
tf
.
reduce_mean
(
var
))
tf
.
scalar_summary
(
name
+
'/mean'
,
tf
.
reduce_mean
(
var
))
return
return
if
action
==
'rms'
:
tf
.
scalar_summary
(
name
+
'/rms'
,
tf
.
sqrt
(
tf
.
reduce_mean
(
tf
.
square
(
var
))))
return
raise
RuntimeError
(
"Unknown action {}"
.
format
(
action
))
raise
RuntimeError
(
"Unknown action {}"
.
format
(
action
))
import
re
import
re
...
...
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