magnet.graph_utils.expected_normalized_cut#

magnet.graph_utils.expected_normalized_cut(Y: Tensor, graph: Data) Tensor#

Compute the expected normalized cut for a bipartition.

Parameters:
  • Y (torch.Tensor) – Tensor of shape (num_nodes, 2) whose values are the probabilities of belonging to one of two sets, assigned by the agglomeration model, to each node of the graph.

  • graph (Data) – Graph on which the GNN was evaluated.

Returns:

The value of the expected normalized cut.

Return type:

torch.Tensor

Notes

For a detailed explanation of the definition of the expected normalized cut, see [1]. [1] arXiv:2210.17457v2