graphs¶
A module containing different graph representations in GraphNeT.
- class graphnet.models.graphs.graphs.KNNGraph(*args, **kwargs)[source]¶
Bases:
GraphDefinitionA Graph representation where Edges are drawn to nearest neighbours.
Construct k-nn graph representation.
- Parameters:
detector (
Detector) – Detector that represents your data.node_definition (
NodeDefinition, default:NodesAsPulses()) – Definition of nodes in the graph.node_feature_names (
Optional[List[str]], default:None) – Name of node features.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