magnet.graph_utils.cut#
- magnet.graph_utils.cut(Y: Tensor, edge_index: Tensor)#
Compute the cut of a bipartite graph.
- Parameters:
Y (torch.Tensor) – Tensor of shape (num_nodes, 2) whose values are a one-hot encoding of the bipartition of the graph.
edge_index (torch.Tensor) – Edge index tensor of the graph.
- Returns:
Value of the cut.
- Return type:
torch.Tensor
Notes
If Y is a tensor of probabilities, this is the expected cut.