Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FCN-CD-PyTorch
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
manli
FCN-CD-PyTorch
Commits
31e99e9f
Commit
31e99e9f
authored
4 years ago
by
Bobholamovic
Browse files
Options
Downloads
Patches
Plain Diff
Add comment in metrics.py
parent
eb381382
No related branches found
No related tags found
1 merge request
!1
Update content
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/utils/metrics.py
+4
-1
4 additions, 1 deletion
src/utils/metrics.py
with
4 additions
and
1 deletion
src/utils/metrics.py
+
4
−
1
View file @
31e99e9f
...
...
@@ -66,9 +66,12 @@ class Metric(AverageMeter):
return
self
.
_compute
(
cm
)[
1
]
def
update
(
self
,
pred
,
true
,
n
=
1
):
# Note that this is no thread-safe
self
.
_cm
.
update
(
true
.
ravel
(),
pred
.
ravel
())
if
self
.
mode
==
'
accum
'
:
# Note that accumulation mode is special in that metric.val saves historical information.
# Therefore, metric.avg IS USUALLY NOT THE "AVERAGE" VALUE YOU WANT!!!
# Instead, metric.val is the averaged result in the sense of metric.avg in separ mode,
# while metric.avg can be considered as some average of average.
cm
=
self
.
_cm
.
sum
elif
self
.
mode
==
'
separ
'
:
cm
=
self
.
_cm
.
val
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment