pygmtools.utils

Utility functions: problem formulating, data processing, and beyond.

Functions

build_aff_mat

Build affinity matrix for graph matching from input node/edge features.

build_aff_mat_from_graphml

Convert networkx object to affinity matrix

build_aff_mat_from_networkx

Convert networkx object to affinity matrix

build_aff_mat_from_pyg

Convert torch_geometric.data.Data object to affinity matrix

build_batch

Build a batched tensor from a list of tensors.

compute_affinity_score

Compute the affinity score of graph matching.

dense_to_sparse

Convert a dense connectivity/adjacency matrix to a sparse connectivity/adjacency matrix and an edge weight tensor.

download

Check if content exits.

from_graphml

Convert graphml object to adjacency matrix

from_networkx

Convert networkx object to adjacency matrix

from_numpy

Convert a numpy ndarray to a tensor.

from_pyg

Convert torch_geometric.data.Data object to adjacency matrix

gaussian_aff_fn

Gaussian kernel affinity function.

generate_isomorphic_graphs

Generate a set of isomorphic graphs, for testing purposes and examples.

get_network

Get the network object of a neural network solver.

inner_prod_aff_fn

Inner product affinity function.

permutation_loss

Binary cross entropy loss between two permutations, also known as "permutation loss".

set_backend

Set the default backend.

to_graphml

Write an adjacency matrix to a GraphML file

to_networkx

Convert adjacency matrix to NetworkX object

to_numpy

Convert a tensor to a numpy ndarray.

to_pyg

Convert adjacency matrix to torch_geometric.data.Data object

Classes

MultiMatchingResult

A memory-efficient class for multi-graph matching results.