Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
K
KerasROOTClassification
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD 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
Nikolai.Hartmann
KerasROOTClassification
Commits
99f3359d
Commit
99f3359d
authored
6 years ago
by
Nikolai.Hartmann
Browse files
Options
Downloads
Patches
Plain Diff
more options for overlay functions - multiple projects in browsing script
parent
3432c091
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
browse.py
+7
-0
7 additions, 0 deletions
browse.py
compare.py
+17
-4
17 additions, 4 deletions
compare.py
toolkit.py
+3
-1
3 additions, 1 deletion
toolkit.py
with
27 additions
and
5 deletions
browse.py
+
7
−
0
View file @
99f3359d
...
...
@@ -10,3 +10,10 @@ logging.basicConfig()
logging
.
getLogger
(
"
KerasROOTClassification
"
).
setLevel
(
logging
.
INFO
)
c
=
ClassificationProject
(
sys
.
argv
[
1
])
cs
=
[]
cs
.
append
(
c
)
if
len
(
sys
.
argv
)
>
2
:
for
project_name
in
sys
.
argv
[
2
:]:
cs
.
append
(
ClassificationProject
(
project_name
))
This diff is collapsed.
Click to expand it.
compare.py
+
17
−
4
View file @
99f3359d
...
...
@@ -37,7 +37,13 @@ def overlay_ROC(filename, *projects):
plt
.
savefig
(
filename
)
plt
.
clf
()
def
overlay_loss
(
filename
,
*
projects
):
def
overlay_loss
(
filename
,
*
projects
,
**
kwargs
):
xlim
=
kwargs
.
pop
(
"
xlim
"
,
None
)
ylim
=
kwargs
.
pop
(
"
ylim
"
,
None
)
log
=
kwargs
.
pop
(
"
log
"
,
False
)
if
kwargs
:
raise
KeyError
(
"
Unknown kwargs: {}
"
.
format
(
kwargs
))
logger
.
info
(
"
Overlay loss curves for {}
"
.
format
([
p
.
name
for
p
in
projects
]))
...
...
@@ -45,11 +51,18 @@ def overlay_loss(filename, *projects):
colors
=
prop_cycle
.
by_key
()[
'
color
'
]
for
p
,
color
in
zip
(
projects
,
colors
):
plt
.
semilogy
(
p
.
history
.
history
[
'
loss
'
],
linestyle
=
'
--
'
,
label
=
"
Training Loss
"
+
p
.
name
,
color
=
color
)
plt
.
semilogy
(
p
.
history
.
history
[
'
val_loss
'
],
label
=
"
Validation Loss
"
+
p
.
name
,
color
=
color
)
hist_dict
=
p
.
csv_hist
plt
.
plot
(
hist_dict
[
'
loss
'
],
linestyle
=
'
--
'
,
label
=
"
Training Loss
"
+
p
.
name
,
color
=
color
)
plt
.
plot
(
hist_dict
[
'
val_loss
'
],
label
=
"
Validation Loss
"
+
p
.
name
,
color
=
color
)
plt
.
ylabel
(
'
loss
'
)
plt
.
xlabel
(
'
epoch
'
)
if
log
:
plt
.
yscale
(
"
log
"
)
if
xlim
is
not
None
:
plt
.
xlim
(
*
xlim
)
if
ylim
is
not
None
:
plt
.
ylim
(
*
ylim
)
plt
.
legend
(
loc
=
'
upper right
'
)
plt
.
savefig
(
filename
)
plt
.
clf
()
...
...
This diff is collapsed.
Click to expand it.
toolkit.py
+
3
−
1
View file @
99f3359d
...
...
@@ -980,7 +980,7 @@ class ClassificationProject(object):
hist_dict
[
hist_key
]
=
[
float
(
line
[
hist_key_index
])
for
line
in
history_list
[
1
:]]
return
hist_dict
def
plot_loss
(
self
,
all_trainings
=
False
,
log
=
False
,
ylim
=
None
):
def
plot_loss
(
self
,
all_trainings
=
False
,
log
=
False
,
ylim
=
None
,
xlim
=
None
):
"""
Plot the value of the loss function for each epoch
...
...
@@ -1004,6 +1004,8 @@ class ClassificationProject(object):
plt
.
legend
([
'
train
'
,
'
test
'
],
loc
=
'
upper left
'
)
if
log
:
plt
.
yscale
(
"
log
"
)
if
xlim
is
not
None
:
plt
.
xlim
(
*
xlim
)
if
ylim
is
not
None
:
plt
.
ylim
(
*
ylim
)
plt
.
savefig
(
os
.
path
.
join
(
self
.
project_dir
,
"
losses.pdf
"
))
...
...
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