magnet.graph_utils.volumes#

magnet.graph_utils.volumes(Y: Tensor, edge_index: Tensor)#

Compute the volumes of a partitioned graph.

Parameters:
  • Y (torch.Tensor) – Tensor of shape (num_nodes, num_subsets) whose values are a one-hot encoding of the partition of the graph.

  • edge_index (torch.Tensor) – Edge index tensor of the graph.

Returns:

Tensor of length num_subsets containing the volumes of each subgraph.

Return type:

torch.Tensor

Notes

If Y is a tensor of probabilities, these are the expected volumes.