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
3d9dc7d0
Commit
3d9dc7d0
authored
Aug 08, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(fix #369)
parent
a682083f
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
tensorpack/graph_builder/model_desc.py
tensorpack/graph_builder/model_desc.py
+1
-1
tensorpack/models/regularize.py
tensorpack/models/regularize.py
+2
-2
No files found.
tensorpack/graph_builder/model_desc.py
View file @
3d9dc7d0
...
...
@@ -147,7 +147,7 @@ class ModelDesc(ModelDescBase):
"""
cost
=
self
.
_get_cost
()
reg_cost
=
regularize_cost_from_collection
()
if
reg_cost
:
if
reg_cost
is
not
None
:
return
tf
.
add
(
cost
,
reg_cost
,
name
=
'cost_with_regularizer'
)
else
:
return
cost
...
...
tensorpack/models/regularize.py
View file @
3d9dc7d0
...
...
@@ -64,7 +64,7 @@ def regularize_cost_from_collection(name='regularize_cost'):
In replicated mode, will only regularize variables within the current tower.
Returns:
a scalar tensor, the regularization loss, or
0
a scalar tensor, the regularization loss, or
None
"""
regularization_losses
=
set
(
tf
.
get_collection
(
tf
.
GraphKeys
.
REGULARIZATION_LOSSES
))
ctx
=
get_current_tower_context
()
...
...
@@ -77,7 +77,7 @@ def regularize_cost_from_collection(name='regularize_cost'):
reg_loss
=
tf
.
add_n
(
list
(
regularization_losses
),
name
=
name
)
return
reg_loss
else
:
return
0
return
None
@
layer_register
(
log_shape
=
False
,
use_scope
=
False
)
...
...
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