magnet.graph_utils.normalized_cut#
- magnet.graph_utils.normalized_cut(Y: Tensor, edge_index: Tensor)#
Compute normalized cut for a bipartition.
- 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:
The value of the loss function.
- Return type:
torch.Tensor
Notes
If Y is a tensor of probabilities, this is the expected normalized cut.