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
bcee048d
Commit
bcee048d
authored
Dec 30, 2016
by
Yuxin Wu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update hed
parent
eb11e29c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
examples/HED/hed.py
examples/HED/hed.py
+2
-2
tensorpack/utils/stats.py
tensorpack/utils/stats.py
+1
-1
No files found.
examples/HED/hed.py
View file @
bcee048d
...
...
@@ -22,7 +22,7 @@ class Model(ModelDesc):
def
_build_graph
(
self
,
input_vars
):
image
,
edgemap
=
input_vars
image
=
image
-
tf
.
constant
([
104
,
116
,
122
],
dtype
=
'float32'
)
edgemap
=
tf
.
expand_dims
(
edgemap
,
3
)
edgemap
=
tf
.
expand_dims
(
edgemap
,
3
,
name
=
'edgemap4d'
)
def
branch
(
name
,
l
,
up
):
with
tf
.
variable_scope
(
name
)
as
scope
:
...
...
@@ -171,7 +171,7 @@ def get_config():
ScheduledHyperParamSetter
(
'learning_rate'
,
[(
30
,
6e-6
),
(
45
,
1e-6
),
(
60
,
8e-7
)]),
HumanHyperParamSetter
(
'learning_rate'
),
InferenceRunner
(
dataset_val
,
BinaryClassificationStats
(
'prediction'
,
'edgemap'
))
BinaryClassificationStats
(
'prediction'
,
'edgemap
4d
'
))
]),
model
=
Model
(),
step_per_epoch
=
step_per_epoch
,
...
...
tensorpack/utils/stats.py
View file @
bcee048d
...
...
@@ -86,7 +86,7 @@ class BinaryStatistics(object):
:param pred: 0/1 np array
:param label: 0/1 np array of the same size
"""
assert
pred
.
shape
==
label
.
shape
assert
pred
.
shape
==
label
.
shape
,
"{} != {}"
.
format
(
pred
.
shape
,
label
.
shape
)
self
.
nr_pos
+=
(
label
==
1
)
.
sum
()
self
.
nr_neg
+=
(
label
==
0
)
.
sum
()
self
.
nr_pred_pos
+=
(
pred
==
1
)
.
sum
()
...
...
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