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
Luc Giffon
bolsonaro
Commits
0363926f
Commit
0363926f
authored
Mar 06, 2020
by
Charly Lamothe
Browse files
Add wo_weights and similarity in stage5 loss plot
parent
46a4a8b0
Changes
1
Hide whitespace changes
Inline
Side-by-side
code/compute_results.py
View file @
0363926f
...
...
@@ -420,26 +420,36 @@ if __name__ == "__main__":
omp_with_params_train_scores
,
omp_with_params_dev_scores
,
omp_with_params_test_scores
,
_
,
\
omp_with_params_experiment_score_metric
=
extract_scores_across_seeds_and_extracted_forest_sizes
(
args
.
models_dir
,
args
.
results_dir
,
args
.
experiment_ids
[
2
])
# omp_with_params
#omp_with_params_without_weights
logger
.
info
(
'Loading omp_with_params experiment scores...'
)
omp_with_params_without_weights_train_scores
,
omp_with_params_without_weights_dev_scores
,
omp_with_params_without_weights_test_scores
,
_
,
\
omp_with_params_experiment_score_metric
=
extract_scores_across_seeds_and_extracted_forest_sizes
(
args
.
models_dir
,
args
.
results_dir
,
args
.
experiment_ids
[
2
],
weights
=
False
)
# kmeans_with_params
logger
.
info
(
'Loading kmeans_with_params experiment scores...'
)
kmeans_with_params_train_scores
,
kmeans_with_params_dev_scores
,
kmeans_with_params_test_scores
,
_
,
\
kmeans_with_params_experiment_score_metric
=
extract_scores_across_seeds_and_extracted_forest_sizes
(
args
.
models_dir
,
args
.
results_dir
,
args
.
experiment_ids
[
3
])
# similarity_with_params
logger
.
info
(
'Loading similarity_with_params experiment scores...'
)
similarity_with_params_train_scores
,
similarity_with_params_dev_scores
,
similarity_with_params_test_scores
,
_
,
\
similarity_with_params_experiment_score_metric
=
extract_scores_across_seeds_and_extracted_forest_sizes
(
args
.
models_dir
,
args
.
results_dir
,
args
.
experiment_ids
[
4
])
# Sanity check on the metrics retreived
if
not
(
base_with_params_experiment_score_metric
==
random_with_params_experiment_score_metric
==
omp_with_params_experiment_score_metric
==
kmeans_with_params_experiment_score_metric
):
raise
ValueError
(
'Score metrics of all experiments must be the same.'
)
experiments_score_metric
=
base_with_params_experiment_score_metric
output_path
=
os
.
path
.
join
(
args
.
results_dir
,
args
.
dataset_name
,
'stage5
_kmeans
'
)
output_path
=
os
.
path
.
join
(
args
.
results_dir
,
args
.
dataset_name
,
'stage5'
)
pathlib
.
Path
(
output_path
).
mkdir
(
parents
=
True
,
exist_ok
=
True
)
Plotter
.
plot_stage2_losses
(
file_path
=
output_path
+
os
.
sep
+
'losses.png'
,
all_experiment_scores
=
[
base_with_params_test_scores
,
random_with_params_test_scores
,
omp_with_params_test_scores
,
kmeans
_with_params_test_scores
],
all_labels
=
[
'base'
,
'random'
,
'omp'
,
'
kmeans
'
],
omp_with_params_without_weights_test_scores
,
kmeans_with_params_test_scores
,
similarity
_with_params_test_scores
],
all_labels
=
[
'base'
,
'random'
,
'omp'
,
'
omp_without_weights'
,
'kmeans'
,
'similarity
'
],
x_value
=
with_params_extracted_forest_sizes
,
xlabel
=
'Number of trees extracted'
,
ylabel
=
experiments_score_metric
,
...
...
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