Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
reconstruction_benchmarks
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
Package registry
Container 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
EIC
benchmarks
reconstruction_benchmarks
Commits
41825bf0
Commit
41825bf0
authored
2 years ago
by
Chao Peng
Browse files
Options
Downloads
Patches
Plain Diff
add a run_type for run_benchmark.py
parent
1516a7c6
No related branches found
No related tags found
1 merge request
!287
Add plot script for e/pi separation performance
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
benchmarks/imaging_shower_ML/run_benchmark.py
+18
-10
18 additions, 10 deletions
benchmarks/imaging_shower_ML/run_benchmark.py
with
18 additions
and
10 deletions
benchmarks/imaging_shower_ML/run_benchmark.py
+
18
−
10
View file @
41825bf0
...
@@ -26,14 +26,14 @@ FILE_NAMES = dict(
...
@@ -26,14 +26,14 @@ FILE_NAMES = dict(
prep_script
=
os
.
path
.
join
(
SDIR
,
'
scripts
'
,
'
ml_data_preprocess.py
'
),
prep_script
=
os
.
path
.
join
(
SDIR
,
'
scripts
'
,
'
ml_data_preprocess.py
'
),
ml_script
=
os
.
path
.
join
(
SDIR
,
'
scripts
'
,
'
ml_training.py
'
),
ml_script
=
os
.
path
.
join
(
SDIR
,
'
scripts
'
,
'
ml_training.py
'
),
sim_dir
=
os
.
path
.
join
(
'
{outdir}
'
,
'
sim_data
'
),
sim_dir
=
os
.
path
.
join
(
'
{outdir}
'
,
'
{run_type}
'
,
'
sim_data
'
),
epscan_dir
=
os
.
path
.
join
(
'
{outdir}
'
,
'
epcut
'
),
epscan_dir
=
os
.
path
.
join
(
'
{outdir}
'
,
'
{run_type}
'
,
'
epcut
'
),
ml_dir
=
os
.
path
.
join
(
'
{outdir}
'
,
'
ml_result
'
),
ml_dir
=
os
.
path
.
join
(
'
{outdir}
'
,
'
{run_type}
'
,
'
ml_result
'
),
gen_file
=
os
.
path
.
join
(
'
{outdir}
'
,
'
sim_data
'
,
'
{ntag}_gen.hepmc
'
),
gen_file
=
os
.
path
.
join
(
'
{outdir}
'
,
'
{run_type}
'
,
'
sim_data
'
,
'
{ntag}_gen.hepmc
'
),
sim_file
=
os
.
path
.
join
(
'
{outdir}
'
,
'
sim_data
'
,
'
{ntag}_sim.edm4hep.root
'
),
sim_file
=
os
.
path
.
join
(
'
{outdir}
'
,
'
{run_type}
'
,
'
sim_data
'
,
'
{ntag}_sim.edm4hep.root
'
),
rec_file
=
os
.
path
.
join
(
'
{outdir}
'
,
'
sim_data
'
,
'
{ntag}_rec.root
'
),
rec_file
=
os
.
path
.
join
(
'
{outdir}
'
,
'
{run_type}
'
,
'
sim_data
'
,
'
{ntag}_rec.root
'
),
ml_file
=
os
.
path
.
join
(
'
{outdir}
'
,
'
sim_data
'
,
'
{ntag}_data.h5
'
),
ml_file
=
os
.
path
.
join
(
'
{outdir}
'
,
'
{run_type}
'
,
'
sim_data
'
,
'
{ntag}_data.h5
'
),
)
)
# default values for argument parser
# default values for argument parser
DEFAULT_COMPACT
=
os
.
path
.
join
(
DEFAULT_COMPACT
=
os
.
path
.
join
(
...
@@ -124,11 +124,17 @@ if __name__ == '__main__':
...
@@ -124,11 +124,17 @@ if __name__ == '__main__':
default
=
'
sim_output
'
,
default
=
'
sim_output
'
,
help
=
'
output directory.
'
help
=
'
output directory.
'
)
)
parser
.
add_argument
(
'
-r
'
,
'
--run-type
'
,
type
=
str
,
dest
=
'
run_type
'
,
default
=
'
epic_imcal
'
,
help
=
'
a name specify the run type.
'
)
parser
.
add_argument
(
parser
.
add_argument
(
'
-t
'
,
'
--name-tag
'
,
type
=
str
,
'
-t
'
,
'
--name-tag
'
,
type
=
str
,
dest
=
'
ntag
'
,
dest
=
'
ntag
'
,
default
=
'
imcal_ml
'
,
default
=
'
imcal_ml
'
,
help
=
'
name tag for output files.
'
help
=
'
a
name tag for output files.
'
)
)
parser
.
add_argument
(
parser
.
add_argument
(
'
-c
'
,
'
--compact
'
,
type
=
str
,
'
-c
'
,
'
--compact
'
,
type
=
str
,
...
@@ -271,11 +277,13 @@ if __name__ == '__main__':
...
@@ -271,11 +277,13 @@ if __name__ == '__main__':
# save run information
# save run information
# NOTE: runs with the same outdir will be combined (overwrite if nametag is the same)
# NOTE: runs with the same outdir will be combined (overwrite if nametag is the same)
run_data
=
{
args
.
ntag
:
kwargs
}
run_data
=
{
args
.
run_type
:
{
args
.
ntag
:
kwargs
}
}
try
:
try
:
with
open
(
os
.
path
.
join
(
args
.
outdir
,
'
result.json
'
),
'
r
'
)
as
f
:
with
open
(
os
.
path
.
join
(
args
.
outdir
,
'
result.json
'
),
'
r
'
)
as
f
:
run_data
=
json
.
load
(
f
)
run_data
=
json
.
load
(
f
)
run_data
.
update
({
args
.
ntag
:
kwargs
})
run_info
=
run_data
.
get
(
args
.
run_type
,
{})
run_info
.
update
({
args
.
ntag
:
kwargs
})
run_data
[
args
.
run_type
]
=
run_info
except
(
FileNotFoundError
,
json
.
decoder
.
JSONDecodeError
):
except
(
FileNotFoundError
,
json
.
decoder
.
JSONDecodeError
):
pass
pass
...
...
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