standard_model

Standard model class(es).

class graphnet.models.standard_model.StandardModel(*args, **kwargs)[source]

Bases: EasySyntax

A Standard way of combining model components in GraphNeT.

This model is compatible with the vast majority of supervised learning tasks such as regression, binary and multi-label classification.

Capable of producing both event-level and pulse-level predictions.

Construct StandardModel.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

object

compute_loss(preds, data, verbose)[source]

Compute and sum losses across tasks.

Return type:

Tensor

Parameters:
  • preds (Tensor)

  • data (List[Data])

  • verbose (bool)

forward(data)[source]

Forward pass, chaining model components.

Return type:

List[Union[Tensor, Data]]

Parameters:

data (Data | List[Data])

shared_step(batch, batch_idx)[source]

Perform shared step.

Applies the forward pass and the following loss calculation, shared between the training and validation step.

Return type:

Tensor

Parameters:
  • batch (List[Data])

  • batch_idx (int)

validate_tasks()[source]

Verify that self._tasks contain compatible elements.

Return type:

None