nodes

Class(es) for building/connecting graphs.

class graphnet.models.graphs.nodes.nodes.NodeDefinition(*args, **kwargs)[source]

Bases: Model

Base class for graph building.

Construct Detector.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

object

forward(x)[source]

Construct nodes from raw node features.

Parameters:
  • x (tensor) – standardized node features with shape ´[num_pulses, d]´,

  • features. (where ´d´ is the number of node)

  • node_feature_names – list of names for each column in ´x´.

Returns:

a graph without edges new_features_name: List of new feature names.

Return type:

graph

property nb_outputs: int

Return number of output features.

This the default, but may be overridden by specific inheriting classes.

set_number_of_inputs(input_feature_names)[source]

Return number of inputs expected by node definition.

Parameters:

input_feature_names (List[str]) – name of each input feature column.

Return type:

None

set_output_feature_names(input_feature_names)[source]

Set output features names as a member variable.

Parameters:
  • input_feature_names (List[str]) – List of column names of the input to the

  • definition. (node)

Return type:

None

class graphnet.models.graphs.nodes.nodes.NodesAsPulses(*args, **kwargs)[source]

Bases: NodeDefinition

Represent each measured pulse of Cherenkov Radiation as a node.

Construct Detector.

Parameters:
  • args (Any)

  • kwargs (Any)

Return type:

object

class graphnet.models.graphs.nodes.nodes.PercentileClusters(*args, **kwargs)[source]

Bases: NodeDefinition

Represent nodes as clusters with percentile summary node features.

If cluster_on is set to the xyz coordinates of DOMs e.g. cluster_on = [‘dom_x’, ‘dom_y’, ‘dom_z’], each node will be a unique DOM and the pulse information (charge, time) is summarized using percentiles.

Construct PercentileClusters.

Parameters:
  • cluster_on (List[str]) – Names of features to create clusters from.

  • percentiles (List[int]) – List of percentiles. E.g. [10, 50, 90].

  • add_counts (bool, default: True) – If True, number of duplicates is added to output array.

  • input_feature_names (Optional[List[str]], default: None) – (Optional) column names for input features.

  • args (Any)

  • kwargs (Any)

Return type:

object

class graphnet.models.graphs.nodes.nodes.NodeAsDOMTimeSeries(*args, **kwargs)[source]

Bases: NodeDefinition

Represent each node as a DOM with time and charge time series data.

Construct NodeAsDOMTimeSeries.

Parameters:
  • keys (List[str], default: ['dom_x', 'dom_y', 'dom_z', 'dom_time', 'charge']) – Names of features in the data (in order).

  • id_columns (List[str], default: ['dom_x', 'dom_y', 'dom_z']) – List of columns that uniquely identify a DOM.

  • time_column (str, default: 'dom_time') – Name of time column.

  • charge_column (str, default: 'charge') – Name of charge column.

  • max_activations (Optional[int], default: None) – Maximum number of activations to include in the time series.

  • args (Any)

  • kwargs (Any)

Return type:

object

class graphnet.models.graphs.nodes.nodes.IceMixNodes(*args, **kwargs)[source]

Bases: NodeDefinition

Calculate ice properties and perform random sampling.

Ice properties are calculated based on the z-coordinate of the pulse. For each event, a random sampling is performed to keep the number of pulses below a maximum number of pulses if n_pulses is over the limit.

Construct IceMixNodes.

Parameters:
  • input_feature_names (Optional[List[str]], default: None) – Column names for input features. Minimum

  • names. (required features are z coordinate and hlc column)

  • max_pulses (int, default: 768) – Maximum number of pulses to keep in the event.

  • z_name (str, default: 'dom_z') – Name of the z-coordinate column.

  • hlc_name (Optional[str], default: 'hlc') – Name of the Hard Local Coincidence Check column.

  • add_ice_properties (bool, default: True) – If True, scattering and absoption length of

  • coordinate. (ice in IceCube are added to the feature set based on z)

  • ice_args (Dict[str, Optional[float]], default: {'z_offset': None, 'z_scaling': None}) – Offset and scaling of the z coordinate in the Detector,

  • data. (to be able to make similar conversion in the ice)

  • args (Any)

  • kwargs (Any)

Return type:

object