reconstruction

Reconstruction-specific Model class(es).

class graphnet.models.task.reconstruction.AzimuthReconstructionWithKappa(*args, **kwargs)[source]

Bases: Task

Reconstructs azimuthal angle and associated kappa (1/var).

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['azimuth']
default_prediction_labels = ['azimuth_pred', 'azimuth_kappa']
nb_inputs = 2
class graphnet.models.task.reconstruction.AzimuthReconstruction(*args, **kwargs)[source]

Bases: AzimuthReconstructionWithKappa

Reconstructs azimuthal angle.

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['azimuth']
default_prediction_labels = ['azimuth_pred']
nb_inputs = 2
class graphnet.models.task.reconstruction.DirectionReconstructionWithKappa(*args, **kwargs)[source]

Bases: Task

Reconstructs direction with kappa from the 3D-vMF distribution.

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['direction']
default_prediction_labels = ['dir_x_pred', 'dir_y_pred', 'dir_z_pred', 'direction_kappa']
nb_inputs = 3
class graphnet.models.task.reconstruction.ZenithReconstruction(*args, **kwargs)[source]

Bases: Task

Reconstructs zenith angle.

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['zenith']
default_prediction_labels = ['zenith_pred']
nb_inputs = 1
class graphnet.models.task.reconstruction.ZenithReconstructionWithKappa(*args, **kwargs)[source]

Bases: ZenithReconstruction

Reconstructs zenith angle and associated kappa (1/var).

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['zenith']
default_prediction_labels = ['zenith_pred', 'zenith_kappa']
nb_inputs = 2
class graphnet.models.task.reconstruction.EnergyReconstruction(*args, **kwargs)[source]

Bases: Task

Reconstructs energy using stable method.

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['energy']
default_prediction_labels = ['energy_pred']
nb_inputs = 1
class graphnet.models.task.reconstruction.EnergyReconstructionWithPower(*args, **kwargs)[source]

Bases: Task

Reconstructs energy.

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['energy']
default_prediction_labels = ['energy_pred']
nb_inputs = 1
class graphnet.models.task.reconstruction.EnergyReconstructionWithUncertainty(*args, **kwargs)[source]

Bases: EnergyReconstruction

Reconstructs energy and associated uncertainty (log(var)).

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['energy']
default_prediction_labels = ['energy_pred', 'energy_sigma']
nb_inputs = 2
class graphnet.models.task.reconstruction.VertexReconstruction(*args, **kwargs)[source]

Bases: Task

Reconstructs vertex position and time.

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['vertex']
default_prediction_labels = ['position_x_pred', 'position_y_pred', 'position_z_pred', 'interaction_time_pred']
nb_inputs = 4
class graphnet.models.task.reconstruction.PositionReconstruction(*args, **kwargs)[source]

Bases: Task

Reconstructs vertex position.

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['position']
default_prediction_labels = ['position_x_pred', 'position_y_pred', 'position_z_pred']
nb_inputs = 3
class graphnet.models.task.reconstruction.TimeReconstruction(*args, **kwargs)[source]

Bases: Task

Reconstructs time.

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['interaction_time']
default_prediction_labels = ['interaction_time_pred']
nb_inputs = 1
class graphnet.models.task.reconstruction.InelasticityReconstruction(*args, **kwargs)[source]

Bases: Task

Reconstructs interaction inelasticity.

That is, 1-(track energy / hadronic energy).

Construct Task.

Parameters:
  • hidden_size (int) – The number of nodes in the layer feeding into this tasks, used to construct the affine transformation to the predicted quantity.

  • loss_function (LossFunction) – Loss function appropriate to the task.

  • target_labels (Union[str, List[str], None], default: None) – Name(s) of the quantity/-ies being predicted, used to extract the target tensor(s) from the Data object in .compute_loss(…).

  • prediction_labels (Union[str, List[str], None], default: None) – The name(s) of each column that is predicted by the model during inference. If not given, the name will auto matically be set to target_label + _pred.

  • transform_prediction_and_target (Optional[Callable], default: None) – Optional function to transform both the predicted and target tensor before passing them to the loss function. Useful e.g. for having the model predict quantities on a physical scale, but transforming this scale to O(1) for a numerically stable loss computation.

  • transform_target (Optional[Callable], default: None) – Optional function to transform only the target tensor before passing it, and the predicted tensor, to the loss function. Useful e.g. for having the model predict a transformed version of the target quantity, e.g. the log10- scaled energy, rather than the physical quantity itself. Used in conjunction with transform_inference to perform the inverse transform on the predicted quantity to recover the physical scale.

  • transform_inference (Optional[Callable], default: None) – Optional function to inverse-transform the model prediction to recover a physical scale. Used in conjunction with transform_target.

  • transform_support (Optional[Tuple], default: None) – Optional tuple to specify minimum and maximum of the range of validity for the inverse transforms transform_target and transform_inference in case this is restricted. By default the invertibility of transform_target is tested on the range [-1e6, 1e6].

  • loss_weight (Optional[str], default: None) – Name of the attribute in data containing per-event loss weights.

  • args (Any) –

  • kwargs (Any) –

Return type:

object

default_target_labels = ['inelasticity']
default_prediction_labels = ['inelasticity_pred']
nb_inputs = 1