From 63caa09664debc5edce658346b2bbc5bf8a2eb97 Mon Sep 17 00:00:00 2001 From: Chao Peng <cpeng@anl.gov> Date: Tue, 22 Nov 2022 02:14:18 +0000 Subject: [PATCH] Fix some typos for imaging ML benchmark --- benchmarks/imaging_shower_ML/config.yml | 2 +- benchmarks/imaging_shower_ML/scripts/epcut_scan.py | 4 ++-- benchmarks/imaging_shower_ML/scripts/ml_training.py | 5 +++-- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/benchmarks/imaging_shower_ML/config.yml b/benchmarks/imaging_shower_ML/config.yml index 5d4429b8..bb410998 100644 --- a/benchmarks/imaging_shower_ML/config.yml +++ b/benchmarks/imaging_shower_ML/config.yml @@ -7,7 +7,7 @@ ml_shower:epi_separation: - | if [[ ${DETECTOR} =~ athena || ${DETECTOR} =~ ecce && ${DETECTOR_CONFIG} =~ imaging ]] ; then - pip3 install -r rbenchmarks/imaging_shower_ML/equirements.txt + pip3 install -r benchmarks/imaging_shower_ML/requirements.txt python3 benchmarks/imaging_shower_ML/run_benchmark.py -t imcal_epi -n 1000 --pmin 1.8 --pmax 2.2 --nocut-samples fi diff --git a/benchmarks/imaging_shower_ML/scripts/epcut_scan.py b/benchmarks/imaging_shower_ML/scripts/epcut_scan.py index 30dddbe4..4340f31f 100644 --- a/benchmarks/imaging_shower_ML/scripts/epcut_scan.py +++ b/benchmarks/imaging_shower_ML/scripts/epcut_scan.py @@ -1,7 +1,7 @@ """ A script to scan the optimized cut on layer and E/p. - It scan all the possible ScFi layers (20 in the EPIC brycecanyon configuration) - The results give the best cut (highest pion rejection) on [layer, E/p] with a targeted electron efficiency + It groups [event, layer] and scan the E/p cut layer-wise (e.g., EPIC brycecanyon configuration has 16 ScFi layers) + The best 2D cut (highest rejection power) on [layer, E/p] that satisfies required effiiency will be given Chao Peng (ANL) 2022/11/13 diff --git a/benchmarks/imaging_shower_ML/scripts/ml_training.py b/benchmarks/imaging_shower_ML/scripts/ml_training.py index 6955ac24..5720dc19 100644 --- a/benchmarks/imaging_shower_ML/scripts/ml_training.py +++ b/benchmarks/imaging_shower_ML/scripts/ml_training.py @@ -131,7 +131,7 @@ if __name__ == '__main__': if args.seed > 0: np.random.seed(args.seed) - tf.random.seed(args.seed) + tf.random.set_seed(args.seed) df = pd.read_hdf(args.data_store, key=imcal_info.ml_data_key) # NOTE: assumed event index is exactly the same as df @@ -274,7 +274,8 @@ if __name__ == '__main__': ), test=OrderedDict( sample_size=count_pid_labels(ytest, pids), - efficiencies=OrderedDict([(labels.name, eff) for labels, eff in effs]) + efficiencies=OrderedDict([(labels.name, eff) for labels, eff in effs]), + rejections=OrderedDict([(labels.name, 1./eff) for labels, eff in effs]), ), ) res_json = json.dumps(result, indent=4, cls=NpEncoder) -- GitLab