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
eb1fa920
Commit
eb1fa920
authored
Jan 18, 2017
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix nan in class_balanced_sigmoid_cross_entropy when only 1 label exists.
parent
8ad7e2b4
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
tensorpack/tfutils/symbolic_functions.py
tensorpack/tfutils/symbolic_functions.py
+2
-2
tensorpack/train/feedfree.py
tensorpack/train/feedfree.py
+1
-1
No files found.
tensorpack/tfutils/symbolic_functions.py
View file @
eb1fa920
...
...
@@ -77,8 +77,8 @@ def class_balanced_sigmoid_cross_entropy(logits, label, name='cross_entropy_loss
pos_weight
=
beta
/
(
1
-
beta
)
cost
=
tf
.
nn
.
weighted_cross_entropy_with_logits
(
logits
=
logits
,
targets
=
y
,
pos_weight
=
pos_weight
)
cost
=
tf
.
reduce_mean
(
cost
*
(
1
-
beta
)
,
name
=
name
)
return
cost
cost
=
tf
.
reduce_mean
(
cost
*
(
1
-
beta
))
return
tf
.
where
(
tf
.
equal
(
count_pos
,
0.0
),
0.0
,
cost
,
name
=
name
)
def
print_stat
(
x
,
message
=
None
):
...
...
tensorpack/train/feedfree.py
View file @
eb1fa920
...
...
@@ -26,7 +26,7 @@ class FeedfreeTrainerBase(Trainer):
def
_trigger_epoch
(
self
):
# run summary_op every epoch
# TODO summary_op will take a data! This is not good for TensorInput.
# TODO
FIXME
summary_op will take a data! This is not good for TensorInput.
if
self
.
summary_op
is
not
None
:
summary_str
=
self
.
summary_op
.
eval
()
self
.
add_summary
(
summary_str
)
...
...
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