Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
PySegCNN
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
earth_observation_public
PySegCNN
Commits
ef5cae60
Commit
ef5cae60
authored
4 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Fixed plot order in plot_loss; increased flexibility for plot_confusion_matrix
parent
aae0cde5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pysegcnn/core/graphics.py
+4
-2
4 additions, 2 deletions
pysegcnn/core/graphics.py
with
4 additions
and
2 deletions
pysegcnn/core/graphics.py
+
4
−
2
View file @
ef5cae60
...
@@ -173,8 +173,7 @@ def plot_confusion_matrix(cm, labels, normalize=True,
...
@@ -173,8 +173,7 @@ def plot_confusion_matrix(cm, labels, normalize=True,
# save figure
# save figure
if
state
is
not
None
:
if
state
is
not
None
:
os
.
makedirs
(
outpath
,
exist_ok
=
True
)
os
.
makedirs
(
outpath
,
exist_ok
=
True
)
fig
.
savefig
(
os
.
path
.
join
(
outpath
,
state
.
replace
(
'
.pt
'
,
'
_cm.png
'
)),
fig
.
savefig
(
os
.
path
.
join
(
outpath
,
state
),
dpi
=
300
,
bbox_inches
=
'
tight
'
)
dpi
=
300
,
bbox_inches
=
'
tight
'
)
return
fig
,
ax
return
fig
,
ax
...
@@ -195,6 +194,9 @@ def plot_loss(loss_file, figsize=(10, 10), step=5,
...
@@ -195,6 +194,9 @@ def plot_loss(loss_file, figsize=(10, 10), step=5,
# an epoch
# an epoch
rm
=
{
k
:
running_mean
(
v
.
flatten
(
'
F
'
),
v
.
shape
[
0
])
for
k
,
v
in
loss
.
items
()}
rm
=
{
k
:
running_mean
(
v
.
flatten
(
'
F
'
),
v
.
shape
[
0
])
for
k
,
v
in
loss
.
items
()}
# sort the keys of the dictionary alphabetically
rm
=
{
k
:
rm
[
k
]
for
k
in
sorted
(
rm
)}
# number of epochs trained
# number of epochs trained
epochs
=
np
.
arange
(
0
,
loss
[
'
tl
'
].
shape
[
1
])
epochs
=
np
.
arange
(
0
,
loss
[
'
tl
'
].
shape
[
1
])
...
...
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