Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
bolsonaro
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
Luc Giffon
bolsonaro
Merge requests
!9
Resolve "Experiment pipeline"
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Resolve "Experiment pipeline"
12-experiment-pipeline
into
master
Overview
0
Commits
38
Pipelines
0
Changes
3
Merged
Charly Lamothe
requested to merge
12-experiment-pipeline
into
master
5 years ago
Overview
0
Commits
38
Pipelines
0
Changes
3
Expand
Closes
#12 (closed)
Edited
5 years ago
by
Charly Lamothe
0
0
Merge request reports
Viewing commit
e9d1cefa
Prev
Next
Show latest version
3 files
+
36
−
25
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
e9d1cefa
Add missing files in previous commit...
· e9d1cefa
Charly Lamothe
authored
5 years ago
code/bolsonaro/visualization/plotter.py
+
16
−
9
Options
@@ -57,10 +57,14 @@ class Plotter(object):
ax
.
plot
(
x_value
,
mean
,
c
=
color_mean
,
label
=
label
)
@staticmethod
def
plot_losses
(
file_path
,
all_experiment_scores_1
,
all_experiment_scores_2
,
x_value
,
xlabel
,
ylabel
,
all_labels
,
title
):
fig
,
axes
=
plt
.
subplots
(
nrows
=
1
,
ncols
=
2
)
def
plot_stage1_losses
(
file_path
,
all_experiment_scores_with_params
,
all_experiment_scores_wo_params
,
x_value
,
xlabel
,
ylabel
,
all_labels
,
title
):
fig
,
axes
=
plt
.
subplots
(
nrows
=
1
,
ncols
=
2
,
sharey
=
True
)
n
=
len
(
all_experiment_scores_1
)
n
=
len
(
all_experiment_scores_with_params
)
if
n
!=
len
(
all_experiment_scores_wo_params
):
raise
ValueError
(
'
all_experiment_scores_with_params and all_experiment_scores_wo_params must have the same len to be compared.
'
)
"""
Get as many different colors from the specified cmap (here nipy_spectral)
@@ -68,7 +72,8 @@ class Plotter(object):
"""
colors
=
Plotter
.
get_colors_from_cmap
(
n
)
for
j
,
all_experiment_scores
in
enumerate
([
all_experiment_scores_1
,
all_experiment_scores_2
]):
for
j
,
all_experiment_scores
in
enumerate
([
all_experiment_scores_with_params
,
all_experiment_scores_wo_params
]):
# For each curve to plot
for
i
in
range
(
n
):
# Retreive the scores in a list for each seed
@@ -88,11 +93,13 @@ class Plotter(object):
label
=
all_labels
[
i
]
)
plt
.
xlabel
(
xlabel
)
plt
.
ylabel
(
ylabel
)
plt
.
title
(
title
)
plt
.
legend
(
loc
=
'
upper right
'
)
fig
.
savefig
(
file_path
,
dpi
=
fig
.
dpi
)
axes
[
0
].
set_xlabel
(
xlabel
)
axes
[
1
].
set_xlabel
(
xlabel
)
axes
[
0
].
set_ylabel
(
ylabel
)
plt
.
suptitle
(
title
)
handles
,
labels
=
axes
[
0
].
get_legend_handles_labels
()
legend
=
axes
[
0
].
legend
(
handles
,
labels
,
loc
=
'
upper center
'
,
bbox_to_anchor
=
(
1.1
,
-
0.15
))
fig
.
savefig
(
file_path
,
dpi
=
fig
.
dpi
,
bbox_extra_artists
=
(
legend
,),
bbox_inches
=
'
tight
'
)
plt
.
close
(
fig
)
@staticmethod
Loading