magnet.graph_utils#

losses module.

Contains loss function definitions for GNNs.

Functions

ENC_multiple(Y, graph)

Compute the expected normalized cut for more than 2 partitions.

align_to_x_axis(coords_sample)

Rotate the data so to align it with the x-axis.

cut(Y, edge_index)

Compute the cut of a bipartite graph.

expected_normalized_cut(Y, graph)

Compute the expected normalized cut for a bipartition.

loss_heterogeneous_domains(Y, graph)

Compute loss function for heterogeneous domains.

neighbours(graph, node)

Get the neighbours of a node.

normalized_cut(Y, edge_index)

Compute normalized cut for a bipartition.

randomrotate(coords_sample)

Randomly rotate the mesh.

volumes(Y, edge_index)

Compute the volumes of a partitioned graph.