Layers and functions for optimal transport in Graph Neural Networks.
Warning
Note that by default the module is not imported in ot. In order to
use it you need to explicitly import ot.gnn. This module is PyTorch Geometric dependent.
The layers are compatible with their API.
\(\mathcal{G}=\{(\overline{C}_k,\overline{F}_k,\overline{h}_k) \}_{k \in \{1,...,K \}} \}\) is the set of \(K\) templates characterized by their adjacency matrices \(\overline{C}_k\), their feature matrices \(\overline{F}_k\) and their node weights \(\overline{h}_k\).
\(C\), \(F\) and \(h\) are respectively the adjacency matrix, the feature matrix and the node weights of the graph.
\(\alpha\) is the trade-off parameter between features and structure for the Fused Gromov-Wasserstein distance.
Parameters:
n_features (int) – Feature dimension of the nodes.
n_tplt_nodes (int) – Number of nodes in each template.
alpha (float, optional) – FGW trade-off parameter (0 < alpha < 1). If None alpha is trained, else it is fixed at the given value.
Weights features (alpha=0) and structure (alpha=1).
train_node_weights (bool, optional) – If True, the templates node weights are learned.
Else, they are uniform.
multi_alpha (bool, optional) – If True, the alpha parameter is a vector of size n_tplt.
feature_init_mean (float, optional) – Mean of the random normal law to initialize the template features.
feature_init_std (float, optional) – Standard deviation of the random normal law to initialize the template features.
\(\mathcal{G}=\{(\overline{F}_k,\overline{h}_k) \}_{k \in \{1,...,K \}} \}\) is the set of \(K\) templates charactersised by their feature matrices \(\overline{F}_k\) and their node weights \(\overline{h}_k\).
\(F\) and \(h\) are respectively the feature matrix and the node weights of the graph.
Parameters:
n_features (int) – Feature dimension of the nodes.