Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
pseudo_image
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
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
Léo Schneider
pseudo_image
Commits
ad42bc95
Commit
ad42bc95
authored
2 months ago
by
Schneider Leo
Browse files
Options
Downloads
Patches
Plain Diff
add : ray result analysis
parent
5252e23b
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
image_ref/main_ray.py
+33
-4
33 additions, 4 deletions
image_ref/main_ray.py
main_ray.py
+30
-1
30 additions, 1 deletion
main_ray.py
with
63 additions
and
5 deletions
image_ref/main_ray.py
+
33
−
4
View file @
ad42bc95
...
@@ -275,13 +275,42 @@ def main(args, gpus_per_trial=1):
...
@@ -275,13 +275,42 @@ def main(args, gpus_per_trial=1):
print
(
"
Best trial config: {}
"
.
format
(
best_result
.
config
))
print
(
"
Best trial config: {}
"
.
format
(
best_result
.
config
))
print
(
"
Best trial final validation loss: {}
"
.
format
(
print
(
"
Best trial final validation loss: {}
"
.
format
(
best_result
.
metrics
[
"
loss
"
]))
best_result
.
metrics
[
"
val
loss
"
]))
print
(
"
Best trial final validation accuracy: {}
"
.
format
(
print
(
"
Best trial final validation accuracy: {}
"
.
format
(
best_result
.
metrics
[
"
accuracy
"
]))
best_result
.
metrics
[
"
val acc
"
]))
test_model
(
best_result
,
args
)
test_model
(
best_result
,
args
)
def
analyze_ray_res
(
storage_path
,
exp_name
,
args
,
gpus_per_trial
=
1
):
experiment_path
=
os
.
path
.
join
(
storage_path
,
exp_name
)
print
(
f
"
Loading results from
{
experiment_path
}
...
"
)
trainable
=
tune
.
with_resources
(
tune
.
with_parameters
(
train_model
,
args
=
args
),
resources
=
{
"
cpu
"
:
20
,
"
gpu
"
:
gpus_per_trial
}
)
restored_tuner
=
tune
.
Tuner
.
restore
(
experiment_path
,
trainable
=
trainable
)
results
=
restored_tuner
.
get_results
()
num_results
=
len
(
results
)
print
(
"
Number of results:
"
,
num_results
)
for
i
,
result
in
enumerate
(
results
):
if
result
.
error
:
print
(
f
"
Trial #
{
i
}
had an error:
"
,
result
.
error
)
continue
print
(
f
"
Trial #
{
i
}
finished successfully train loss of :
"
,
result
.
metrics
[
"
train loss
"
],
"
train acc of :
"
,
result
.
metrics
[
"
train cont acc
"
],
"
val loss of :
"
,
result
.
metrics
[
"
val loss
"
],
"
val cont acc of :
"
,
result
.
metrics
[
"
val cont acc
"
],
"
val acc of :
"
,
result
.
metrics
[
"
val acc
"
]
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
args
=
load_args_contrastive
()
args
=
load_args_contrastive
()
print
(
args
)
analyze_ray_res
()
main
(
args
)
# print(args)
# main(args)
This diff is collapsed.
Click to expand it.
main_ray.py
+
30
−
1
View file @
ad42bc95
...
@@ -244,7 +244,36 @@ essayer avec une loss pondérée ou pas pondérée
...
@@ -244,7 +244,36 @@ essayer avec une loss pondérée ou pas pondérée
test_model
(
best_result
,
args
)
test_model
(
best_result
,
args
)
def
analyze_ray_res
(
storage_path
,
exp_name
,
args
,
gpus_per_trial
=
1
):
experiment_path
=
os
.
path
.
join
(
storage_path
,
exp_name
)
print
(
f
"
Loading results from
{
experiment_path
}
...
"
)
trainable
=
tune
.
with_resources
(
tune
.
with_parameters
(
train_model
,
args
=
args
),
resources
=
{
"
cpu
"
:
20
,
"
gpu
"
:
gpus_per_trial
}
)
restored_tuner
=
tune
.
Tuner
.
restore
(
experiment_path
,
trainable
=
trainable
)
results
=
restored_tuner
.
get_results
()
num_results
=
len
(
results
)
print
(
"
Number of results:
"
,
num_results
)
for
i
,
result
in
enumerate
(
results
):
if
result
.
error
:
print
(
f
"
Trial #
{
i
}
had an error:
"
,
result
.
error
)
continue
print
(
f
"
Trial #
{
i
}
finished successfully train loss of :
"
,
result
.
metrics
[
"
train loss
"
],
"
train acc of :
"
,
result
.
metrics
[
"
train cont acc
"
],
"
val loss of :
"
,
result
.
metrics
[
"
val loss
"
],
"
val cont acc of :
"
,
result
.
metrics
[
"
val cont acc
"
],
"
val acc of :
"
,
result
.
metrics
[
"
val acc
"
]
)
if
__name__
==
'
__main__
'
:
if
__name__
==
'
__main__
'
:
args
=
load_args
()
args
=
load_args
()
print
(
args
)
print
(
args
)
main
(
args
)
analyze_ray_res
(
'
/lustre/fswork/projects/rech/bun/ucg81ws/these/pseudo_image/image_ref/ray_results/
'
,
'
base_experiment
'
,
args
)
# main(args)
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