From c522cb55f82e6c23803e01372c0c581642132752 Mon Sep 17 00:00:00 2001 From: dachengx Date: Tue, 19 Nov 2024 14:27:39 -0600 Subject: [PATCH 1/4] Remove GCN pos-rec --- straxen/corrections_services.py | 6 +--- straxen/plugins/events/__init__.py | 3 -- .../plugins/events/event_s2_positions_gcn.py | 30 ------------------ straxen/plugins/peaks/__init__.py | 3 -- straxen/plugins/peaks/peak_positions_gcn.py | 31 ------------------- 5 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 straxen/plugins/events/event_s2_positions_gcn.py delete mode 100644 straxen/plugins/peaks/peak_positions_gcn.py diff --git a/straxen/corrections_services.py b/straxen/corrections_services.py index 71cc26fc9..f8bf2b5f4 100644 --- a/straxen/corrections_services.py +++ b/straxen/corrections_services.py @@ -17,17 +17,13 @@ corrections_w_file = [ "mlp_model", "cnn_model", - "gcn_model", "s2_xy_map_mlp", "s2_xy_map_cnn", - "s2_xy_map_gcn", "s2_xy_map", "s1_xyz_map_mlp", "s1_xyz_map_cnn", - "s1_xyz_map_gcn", "fdc_map_mlp", "fdc_map_cnn", - "fdc_map_gcn", "s1_aft_xyz_map", "bayes_model", ] @@ -284,7 +280,7 @@ def get_config_from_cmt(self, run_id, model_type, version="ONLINE"): utilix.mongo_storage.MongoDownloader() :param run_id: run id from runDB - :param model_type: model type and neural network type; model_mlp, or model_gcn or model_cnn + :param model_type: model type and neural network type; model_mlp, or model_cnn :param version: version :param return: NN weights file name diff --git a/straxen/plugins/events/__init__.py b/straxen/plugins/events/__init__.py index 83887d62a..2580055c7 100644 --- a/straxen/plugins/events/__init__.py +++ b/straxen/plugins/events/__init__.py @@ -58,9 +58,6 @@ from . import event_s2_positions_cnn from .event_s2_positions_cnn import * -from . import event_s2_positions_gcn -from .event_s2_positions_gcn import * - from . import event_s1_positions_cnn from .event_s1_positions_cnn import * diff --git a/straxen/plugins/events/event_s2_positions_gcn.py b/straxen/plugins/events/event_s2_positions_gcn.py deleted file mode 100644 index 0d70bbdbd..000000000 --- a/straxen/plugins/events/event_s2_positions_gcn.py +++ /dev/null @@ -1,30 +0,0 @@ -import strax -import straxen -from straxen.plugins.events._event_s2_positions_base import EventS2PositionBase - - -export, __all__ = strax.exporter() - - -@export -class EventS2PositionGCN(EventS2PositionBase): - """GCN net for position S2 reconstruction at event level.""" - - algorithm = "gcn" - provides = "event_s2_positions_gcn" - - tf_event_model_gcn = straxen.URLConfig( - default=( - "tf://" - "resource://" - f"cmt://{algorithm}_model" - "?version=ONLINE" - "&run_id=plugin.run_id" - "&fmt=abs_path" - ), - help=( - 'MLP model. Should be opened using the "tf" descriptor. ' - 'Set to "None" to skip computation' - ), - cache=3, - ) diff --git a/straxen/plugins/peaks/__init__.py b/straxen/plugins/peaks/__init__.py index e961771df..5667d7d7f 100644 --- a/straxen/plugins/peaks/__init__.py +++ b/straxen/plugins/peaks/__init__.py @@ -22,9 +22,6 @@ from . import peak_positions_cnf from .peak_positions_cnf import * -from . import peak_positions_gcn -from .peak_positions_gcn import * - from . import peak_positions_mlp from .peak_positions_mlp import * diff --git a/straxen/plugins/peaks/peak_positions_gcn.py b/straxen/plugins/peaks/peak_positions_gcn.py deleted file mode 100644 index df883b51a..000000000 --- a/straxen/plugins/peaks/peak_positions_gcn.py +++ /dev/null @@ -1,31 +0,0 @@ -import strax -import straxen -from straxen.plugins.peaks._peak_positions_base import PeakPositionsBaseNT - - -export, __all__ = strax.exporter() - - -@export -class PeakPositionsGCN(PeakPositionsBaseNT): - """Graph Convolutional Network (GCN) neural net for position reconstruction.""" - - provides = "peak_positions_gcn" - algorithm = "gcn" - __version__ = "0.0.1" - - tf_model_gcn = straxen.URLConfig( - default=( - "tf://" - "resource://" - f"cmt://{algorithm}_model" - "?version=ONLINE" - "&run_id=plugin.run_id" - "&fmt=abs_path" - ), - help=( - 'GCN model. Should be opened using the "tf" descriptor. ' - 'Set to "None" to skip computation' - ), - cache=3, - ) From 57cb861ba8f707a8786985024eeedd2aeabdcff0 Mon Sep 17 00:00:00 2001 From: dachengx Date: Tue, 19 Nov 2024 14:30:17 -0600 Subject: [PATCH 2/4] Remove CNN --- straxen/corrections_services.py | 6 +--- straxen/plugins/events/__init__.py | 3 -- .../plugins/events/event_s2_positions_cnn.py | 30 ------------------ straxen/plugins/peaks/__init__.py | 3 -- straxen/plugins/peaks/peak_positions_cnn.py | 31 ------------------- 5 files changed, 1 insertion(+), 72 deletions(-) delete mode 100644 straxen/plugins/events/event_s2_positions_cnn.py delete mode 100644 straxen/plugins/peaks/peak_positions_cnn.py diff --git a/straxen/corrections_services.py b/straxen/corrections_services.py index f8bf2b5f4..ef2eda53b 100644 --- a/straxen/corrections_services.py +++ b/straxen/corrections_services.py @@ -16,14 +16,10 @@ corrections_w_file = [ "mlp_model", - "cnn_model", "s2_xy_map_mlp", - "s2_xy_map_cnn", "s2_xy_map", "s1_xyz_map_mlp", - "s1_xyz_map_cnn", "fdc_map_mlp", - "fdc_map_cnn", "s1_aft_xyz_map", "bayes_model", ] @@ -280,7 +276,7 @@ def get_config_from_cmt(self, run_id, model_type, version="ONLINE"): utilix.mongo_storage.MongoDownloader() :param run_id: run id from runDB - :param model_type: model type and neural network type; model_mlp, or model_cnn + :param model_type: model type and neural network type; model_mlp, or model_cnf :param version: version :param return: NN weights file name diff --git a/straxen/plugins/events/__init__.py b/straxen/plugins/events/__init__.py index 2580055c7..a4e661e9c 100644 --- a/straxen/plugins/events/__init__.py +++ b/straxen/plugins/events/__init__.py @@ -55,9 +55,6 @@ from . import event_s2_positions_mlp from .event_s2_positions_mlp import * -from . import event_s2_positions_cnn -from .event_s2_positions_cnn import * - from . import event_s1_positions_cnn from .event_s1_positions_cnn import * diff --git a/straxen/plugins/events/event_s2_positions_cnn.py b/straxen/plugins/events/event_s2_positions_cnn.py deleted file mode 100644 index bd3d4b98e..000000000 --- a/straxen/plugins/events/event_s2_positions_cnn.py +++ /dev/null @@ -1,30 +0,0 @@ -import strax -import straxen -from straxen.plugins.events._event_s2_positions_base import EventS2PositionBase - - -export, __all__ = strax.exporter() - - -@export -class EventS2PositionCNN(EventS2PositionBase): - """CNN for position S2 reconstruction at event level.""" - - algorithm = "cnn" - provides = "event_s2_positions_cnn" - - tf_event_model_cnn = straxen.URLConfig( - default=( - "tf://" - "resource://" - f"cmt://{algorithm}_model" - "?version=ONLINE" - "&run_id=plugin.run_id" - "&fmt=abs_path" - ), - help=( - 'CNN model. Should be opened using the "tf" descriptor. ' - 'Set to "None" to skip computation' - ), - cache=3, - ) diff --git a/straxen/plugins/peaks/__init__.py b/straxen/plugins/peaks/__init__.py index 5667d7d7f..7bca4104e 100644 --- a/straxen/plugins/peaks/__init__.py +++ b/straxen/plugins/peaks/__init__.py @@ -16,9 +16,6 @@ from . import peak_positions from .peak_positions import * -from . import peak_positions_cnn -from .peak_positions_cnn import * - from . import peak_positions_cnf from .peak_positions_cnf import * diff --git a/straxen/plugins/peaks/peak_positions_cnn.py b/straxen/plugins/peaks/peak_positions_cnn.py deleted file mode 100644 index 22c9bf238..000000000 --- a/straxen/plugins/peaks/peak_positions_cnn.py +++ /dev/null @@ -1,31 +0,0 @@ -import strax -import straxen -from straxen.plugins.peaks._peak_positions_base import PeakPositionsBaseNT - - -export, __all__ = strax.exporter() - - -@export -class PeakPositionsCNN(PeakPositionsBaseNT): - """Convolutional Neural Network (CNN) neural net for position reconstruction.""" - - provides = "peak_positions_cnn" - algorithm = "cnn" - __version__ = "0.0.1" - - tf_model_cnn = straxen.URLConfig( - default=( - "tf://" - "resource://" - f"cmt://{algorithm}_model" - "?version=ONLINE" - "&run_id=plugin.run_id" - "&fmt=abs_path" - ), - help=( - 'CNN model. Should be opened using the "tf" descriptor. ' - 'Set to "None" to skip computation' - ), - cache=3, - ) From ba4287d5fb7ca2aa532c3202ad1ca57555b7ca69 Mon Sep 17 00:00:00 2001 From: dachengx Date: Tue, 19 Nov 2024 15:14:15 -0600 Subject: [PATCH 3/4] CNF as default --- straxen/plugins/defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/straxen/plugins/defaults.py b/straxen/plugins/defaults.py index da19bc1d5..ac2f6b0b0 100644 --- a/straxen/plugins/defaults.py +++ b/straxen/plugins/defaults.py @@ -1,6 +1,6 @@ """Some shared defaults.""" -DEFAULT_POSREC_ALGO = "mlp" +DEFAULT_POSREC_ALGO = "cnf" HE_PREAMBLE = """High energy channels: attenuated signals of the top PMT-array\n""" From 38d085664180a2f96aa6b35916ebef5b7ee1a13c Mon Sep 17 00:00:00 2001 From: dachengx Date: Tue, 19 Nov 2024 18:09:52 -0600 Subject: [PATCH 4/4] Recover MLP as default --- straxen/plugins/defaults.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/straxen/plugins/defaults.py b/straxen/plugins/defaults.py index ac2f6b0b0..da19bc1d5 100644 --- a/straxen/plugins/defaults.py +++ b/straxen/plugins/defaults.py @@ -1,6 +1,6 @@ """Some shared defaults.""" -DEFAULT_POSREC_ALGO = "cnf" +DEFAULT_POSREC_ALGO = "mlp" HE_PREAMBLE = """High energy channels: attenuated signals of the top PMT-array\n"""