labels

Class(es) for constructing training labels at runtime.

class graphnet.training.labels.Label(key)[source]

Bases: ABC, Logger

Base Label class for producing labels from single Data instance.

Construct Label.

Parameters:

key (str) – The name of the field in Data where the label will be stored. That is, graph[key] = label.

property key: str

Return value of key.

class graphnet.training.labels.Direction(key, azimuth_key, zenith_key)[source]

Bases: Label

Class for producing particle direction/pointing label.

Construct Direction.

Parameters:
  • key (str, default: 'direction') – The name of the field in Data where the label will be stored. That is, graph[key] = label.

  • azimuth_key (str, default: 'azimuth') – The name of the pre-existing key in graph that will be used to access the azimiuth angle, used when calculating the direction.

  • zenith_key (str, default: 'zenith') – The name of the pre-existing key in graph that will be used to access the zenith angle, used when calculating the direction.

class graphnet.training.labels.Track(key, pid_key, interaction_key)[source]

Bases: Label

Class for producing NuMuCC label.

Label is set to 1 if the event is a NuMu CC event, else 0.

Construct Track label.

Parameters:
  • key (str, default: 'track') – The name of the field in Data where the label will be stored. That is, graph[key] = label.

  • pid_key (str, default: 'pid') – The name of the pre-existing key in graph that will be used to access the pdg encoding, used when calculating the direction.

  • interaction_key (str, default: 'interaction_type') – The name of the pre-existing key in graph that will be used to access the interaction type (1 denoting CC), used when calculating the direction.