:py:mod:`orcanet.lib.label_modifiers` ===================================== .. py:module:: orcanet.lib.label_modifiers Module Contents --------------- Classes ~~~~~~~ .. autoapisummary:: orcanet.lib.label_modifiers.ColumnLabels orcanet.lib.label_modifiers.RegressionLabels orcanet.lib.label_modifiers.RegressionLabelsSplit orcanet.lib.label_modifiers.ClassificationLabels orcanet.lib.label_modifiers.TSClassifier .. py:class:: ColumnLabels(model) Label of each model output is column with the same name in the h5 file. This is the default label modifier. :Parameters: **model** : ks.Model A keras model. .. !! processed by numpydoc !! .. py:class:: RegressionLabels(columns, model_output=None, log10=False, stacks=None) Generate labels for regression. :Parameters: **columns** : str or list Name(s) of the columns in the label dataset that contain the labels. **model_output** : str, optional Name of the output of the network. Default: Same as columns (only valid if columns is a str). **log10** : bool Take log10 of the labels. Invalid values in the label will produce 0 and a warning. **stacks** : int, optional Stack copies of the label this many times along a new axis at position 1. E.g. if the label is shape (?, 3), it will become shape (?, stacks, 3). Used for lkl regression. .. rubric:: Examples >>> RegressionLabels(columns=['dir_x', 'dir_y', 'dir_z'], model_output='dir') or in the config.toml: label_modifier = {name='RegressionLabels', columns=['dir_x','dir_y','dir_z'], model_output='dir'} Will produce array of shape (bs, 3) for model output 'dir'. >>> RegressionLabels(columns='dir_x') Will produce array of shape (bs, 1) for model output 'dir_x'. .. !! processed by numpydoc !! .. py:method:: process_label(y_value) .. py:class:: RegressionLabelsSplit(*args, **kwargs) Generate labels for regression. Intended for networks that output recos and errs in seperate towers (for example when using OutputRegNormalSplit as output layer block). .. !! processed by numpydoc !! .. py:class:: ClassificationLabels(column, classes, model_output=None) One-hot encoding for general purpose classification labels based on one mc label column. :Parameters: **column** : str Identifier of which mc info to create the labels from. **classes** : dict Specify for each class the conditions the column name has to fulfil. The keys have to be named "class1", "class2", etc **model_output** : str, optional The name of the output layer's outputs. .. !! processed by numpydoc !! .. py:class:: TSClassifier(is_cc_convention, model_output='ts_output') One-hot encoding for track/shower classifier. Muon neutrino CC are tracks, the rest of neutrinos is shower. This means, this has to be extended for tau neutrinos. Atm. muon events, if any, are tracks. :Parameters: **is_cc_convention** : int The convention used in the MC prod to indicate a charged current interaction. For post 2020 productions this is 2. **model_output** : str, optional Name of the output of the network. Default: Same as names (only valid if names is a str). .. !! processed by numpydoc !!