orcanet.lib.label_modifiers

Module Contents

Classes

ColumnLabels

Label of each model output is column with the same name in the h5 file.

RegressionLabels

Generate labels for regression.

RegressionLabelsSplit

Generate labels for regression.

ClassificationLabels

One-hot encoding for general purpose classification labels based on one mc label column.

TSClassifier

One-hot encoding for track/shower classifier. Muon neutrino CC are tracks, the rest

class orcanet.lib.label_modifiers.ColumnLabels(model)[source]

Label of each model output is column with the same name in the h5 file. This is the default label modifier.

Parameters
modelks.Model

A keras model.

class orcanet.lib.label_modifiers.RegressionLabels(columns, model_output=None, log10=False, stacks=None)[source]

Generate labels for regression.

Parameters
columnsstr or list

Name(s) of the columns in the label dataset that contain the labels.

model_outputstr, optional

Name of the output of the network. Default: Same as columns (only valid if columns is a str).

log10bool

Take log10 of the labels. Invalid values in the label will produce 0 and a warning.

stacksint, 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.

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'.
process_label(y_value)[source]
class orcanet.lib.label_modifiers.RegressionLabelsSplit(*args, **kwargs)[source]

Generate labels for regression.

Intended for networks that output recos and errs in seperate towers (for example when using OutputRegNormalSplit as output layer block).

class orcanet.lib.label_modifiers.ClassificationLabels(column, classes, model_output=None)[source]

One-hot encoding for general purpose classification labels based on one mc label column.

Parameters
columnstr

Identifier of which mc info to create the labels from.

classesdict

Specify for each class the conditions the column name has to fulfil. The keys have to be named “class1”, “class2”, etc

model_outputstr, optional

The name of the output layer’s outputs.

class orcanet.lib.label_modifiers.TSClassifier(is_cc_convention, model_output='ts_output')[source]

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_conventionint

The convention used in the MC prod to indicate a charged current interaction. For post 2020 productions this is 2.

model_outputstr, optional

Name of the output of the network. Default: Same as names (only valid if names is a str).