graphnet.models.graphs.graphs module

A module containing different graph representations in GraphNeT.

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

Bases: GraphDefinition

A Graph representation where Edges are drawn to nearest neighbours.

Construct k-nn graph representation.

Parameters:
  • detector (Detector) – Detector that represents your data.

  • node_definition (Optional[NodeDefinition], default: None) – Definition of nodes in the graph.

  • input_feature_names (Optional[List[str]], default: None) – Name of input feature columns.

  • dtype (Optional[dtype], default: torch.float32) – data type for node features.

  • perturbation_dict (Optional[Dict[str, float]], default: None) – Dictionary mapping a feature name to a standard deviation according to which the values for this feature should be randomly perturbed. Defaults to None.

  • seed (Union[int, Generator, None], default: None) – seed or Generator used to randomly sample perturbations. Defaults to None.

  • nb_nearest_neighbours (int, default: 8) – Number of edges for each node. Defaults to 8.

  • columns (List[int], default: [0, 1, 2]) – node feature columns used for distance calculation

  • [0 (. Defaults to)

  • 1

  • 2].

  • args (Any)

  • kwargs (Any)

Return type:

object

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

Bases: GraphDefinition

A Data representation without edge assignment.

I.e the resulting representation is created without an EdgeDefinition.

Construct isolated nodes graph representation.

Parameters:
  • detector (Detector) – Detector that represents your data.

  • node_definition (Optional[NodeDefinition], default: None) – Definition of nodes in the graph.

  • input_feature_names (Optional[List[str]], default: None) – Name of input feature columns.

  • dtype (Optional[dtype], default: torch.float32) – data type for node features.

  • perturbation_dict (Optional[Dict[str, float]], default: None) – Dictionary mapping a feature name to a standard deviation according to which the values for this feature should be randomly perturbed. Defaults to None.

  • seed (Union[int, Generator, None], default: None) – seed or Generator used to randomly sample perturbations. Defaults to None.

  • args (Any)

  • kwargs (Any)

Return type:

object