Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Paul Primus
dcase2020_task2
Commits
d6d43f92
Commit
d6d43f92
authored
Jun 10, 2020
by
Paul Primus
Browse files
fixed auroc bug
parent
9d93ba7f
Changes
1
Show whitespace changes
Inline
Side-by-side
dcase2020_task2/utils/logger.py
View file @
d6d43f92
...
...
@@ -29,7 +29,7 @@ class Logger:
self
.
machine_id
=
self
.
objects
[
'machine_id'
]
# self.writer = SummaryWriter(log_dir=self.log_dir)
file
=
os
.
path
.
join
(
config
[
'log_path'
],
f
'conf_
{
self
.
machine_type
}
_
{
self
.
machine_id
}
.pl'
)
file
=
os
.
path
.
join
(
config
[
'log_path'
],
f
'conf_
{
self
.
machine_type
}
_
id_
{
self
.
machine_id
}
.pl'
)
with
open
(
file
,
'wb'
)
as
config_dictionary_file
:
pickle
.
dump
(
config
,
config_dictionary_file
)
...
...
@@ -145,7 +145,7 @@ class Logger:
nrow
=
num_images
)
self
.
__log_image__
(
grid_img
,
f
'
{
epoch
}
_reconstruction_x.png'
)
self
.
__log_image__
(
grid_img
,
f
'
{
epoch
}
_
_
{
self
.
machine_type
}
_id_
{
self
.
machine_id
}
_
reconstruction_x.png'
)
def
__plot_score_distribution__
(
self
,
scores_mean
,
scores_max
,
ground_truth
,
machine_types
,
machine_ids
):
...
...
@@ -181,7 +181,7 @@ class Logger:
if
i
==
0
and
j
==
0
:
plt
.
legend
(
loc
=
'upper right'
)
plt
.
savefig
(
os
.
path
.
join
(
self
.
log_dir
,
'score_distribution.png'
),
bbox_inches
=
'tight'
)
plt
.
savefig
(
os
.
path
.
join
(
self
.
log_dir
,
f
'score_distribution
_
{
self
.
machine_type
}
_id_
{
self
.
machine_id
}
.png'
),
bbox_inches
=
'tight'
)
plt
.
close
()
def
__compute_metrics__
(
...
...
Write
Preview
Supports
Markdown
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