Belle II Software development
|
Public Member Functions | |
def | __init__ (self, model_file=None, model_config=MODEL_CONFIG, preproc_config=PREPROC_CONFIG, threshold=None, extra_info_var="NN_prediction", global_tag="SmartBKG_GATGAP", payload="GATGAPgen.pth") |
def | initialize (self) |
def | event (self) |
Public Attributes | |
model_file | |
Path to the saved model file. | |
model_config | |
Parameters for building the model. | |
preproc_config | |
Parameters for preprocessing. | |
threshold | |
Threshold for event selection using reweighting method, value None indicating sampling method. | |
extra_info_var | |
Name of eventExtraInfo to save model prediction to. | |
payload | |
Payload for the well-trained model in global tag. | |
model | |
model with trained parameters | |
EventExtraInfo | |
StoreArray to save weights to. | |
EventInfo | |
Initialise event metadata from data store. | |
out_features | |
node features | |
Goals: 1. Build a graph from an event composed of MCParticles 2. Apply the well-trained model for reweighting or sampling method to get a score 3. Execute reweighting or sampling process to get a weight Arguments: model_file(str): Path to the saved model model_config(dict): Parameters to build the model preproc_config(dict): Parameters for preprocessing threshold(float): Threshold for event selection using reweighting method, value *None* indicating sampling mehtod extra_info_var(str): Name of eventExtraInfo to save model prediction to global_tag(str): Tag in ConditionDB where the well trained model was stored payload(str): Payload for the well trained model in global tag Returns: Pass or rejected according to random sampling or selection with the given threshold Note: Score after the NN filter indicating the probability of the event to pass is saved under ``EventExtraInfo.extra_info_var``. Use ``eventExtraInfo(extra_info_var)`` in ``modularAnalysis.variablesToNtuple`` or ``additionalBranches=["EventExtraInfo"]`` in ``mdst.add_mdst_output`` to have access to the scores.
Definition at line 23 of file NN_filter_module.py.
def __init__ | ( | self, | |
model_file = None , |
|||
model_config = MODEL_CONFIG , |
|||
preproc_config = PREPROC_CONFIG , |
|||
threshold = None , |
|||
extra_info_var = "NN_prediction" , |
|||
global_tag = "SmartBKG_GATGAP" , |
|||
payload = "GATGAPgen.pth" |
|||
) |
Initialise the class. :param model_file: Path to the saved model file. :param model_config: Parameters for building the model. :param preproc_config: Parameters for preprocessing. :param threshold: Threshold for event selection using reweighting method, value *None* indicating sampling mehtod. :param extra_info_var: Name of eventExtraInfo to save model prediction to. :param global_tag: Tag in ConditionDB where the well-trained model was stored. :param payload: Payload for the well-trained model in global tag.
Definition at line 50 of file NN_filter_module.py.
def event | ( | self | ) |
Collect information from database, build graphs, make predictions and select through sampling or threshold
Definition at line 112 of file NN_filter_module.py.
def initialize | ( | self | ) |
Initialise module before any events are processed
Definition at line 87 of file NN_filter_module.py.
EventExtraInfo |
StoreArray to save weights to.
Definition at line 102 of file NN_filter_module.py.
EventInfo |
Initialise event metadata from data store.
Definition at line 106 of file NN_filter_module.py.
extra_info_var |
Name of eventExtraInfo to save model prediction to.
Definition at line 80 of file NN_filter_module.py.
model |
model with trained parameters
Definition at line 98 of file NN_filter_module.py.
model_config |
Parameters for building the model.
Definition at line 74 of file NN_filter_module.py.
model_file |
Path to the saved model file.
Definition at line 72 of file NN_filter_module.py.
out_features |
node features
Definition at line 108 of file NN_filter_module.py.
payload |
Payload for the well-trained model in global tag.
Definition at line 82 of file NN_filter_module.py.
preproc_config |
Parameters for preprocessing.
Definition at line 76 of file NN_filter_module.py.
threshold |
Threshold for event selection using reweighting method, value None indicating sampling method.
Definition at line 78 of file NN_filter_module.py.