BaseTransform |
An abstract class for creating transformations Transforms are a way to modify and customize GraphData by implicitly passing them as arguments in mlx_graphs.dataset.Dataset |
Compose |
Chains several transforms together. |
FeaturesNormalizedTransform |
|
ToUndirected |
Makes a graph undirected by adding the reverse of every edge. |
AddSelfLoops |
Adds a self-loop to every node of a graph. |
RemoveSelfLoops |
Removes the self-loops of a graph, together with their per-edge attributes (e.g. edge_features, edge_labels). |
RemoveIsolatedNodes |
Removes the isolated nodes of a graph. |
LargestConnectedComponents |
Keeps only the largest connected components of a graph. |
RandomNodeSplit |
Randomly splits the nodes of a graph into training, validation and test sets, stored as the boolean masks train_mask, val_mask and test_mask of shape [num_nodes]. |
RandomLinkSplit |
Randomly splits the edges of a graph into training, validation and test sets for link prediction. |
OneHotDegree |
Adds the one-hot encoded degree of each node to the node features. |
Constant |
Adds a constant value to the node features of each node. |
AddRandomWalkPE |
Adds the random walk positional encoding of each node, from "Graph Neural Networks with Learnable Structural and Positional Representations". |
GCNNorm |
Applies the GCN normalization from "Semi-supervised Classification with Graph Convolutional Networks" to the edges of a graph and stores the result in edge_weights: |
AddRemainingSelfLoops |
Adds a self-loop to every node of a graph that does not already have one (see add_remaining_self_loops()). |
RemoveDuplicatedEdges |
Removes the duplicated edges of a graph and sorts the edges by source then destination (see coalesce()). |
IndexToMask |
Converts index attributes (named *_index, e.g. train_index) to boolean mask attributes (named *_mask, e.g. train_mask). |
MaskToIndex |
Converts boolean mask attributes (named *_mask, e.g. train_mask) to index attributes (named *_index, e.g. train_index). |
KNNGraph |
Creates a k-NN graph from the node positions pos of a graph. |
RadiusGraph |
Creates the graph connecting the nodes whose positions pos are within a given distance. |
NormalizeFeatures |
Row-normalizes the given attributes to sum up to one, as PyG's NormalizeFeatures. |
TargetIndegree |
Saves the globally normalized in-degree of the target node of each edge in its edge features, as PyG's TargetIndegree: |
LocalDegreeProfile |
Appends the Local Degree Profile (LDP) from "A Simple yet Effective Baseline for Non-attribute Graph Classification" to the node features, as PyG's LocalDegreeProfile: |
AddLaplacianEigenvectorPE |
Adds the Laplacian eigenvector positional encoding from "Benchmarking Graph Neural Networks" to each node, as PyG's AddLaplacianEigenvectorPE. |
SVDFeatureReduction |
Reduces the dimension of the node features with a Singular Value Decomposition, as PyG's SVDFeatureReduction. |
SIGN |
Precomputes the propagated node features of the Scalable Inception Graph Neural Network (SIGN) from "SIGN: Scalable Inception Graph Neural Networks", as PyG's SIGN: |
FeaturePropagation |
Fills in missing node features by propagating the known ones, with the feature propagation algorithm from "On the Unreasonable Effectiveness of Feature propagation in Learning on Graphs with Missing Node Features", as PyG's FeaturePropagation: |
VirtualNode |
Appends a virtual node connected to all the other nodes, as described in "Neural Message Passing for Quantum Chemistry", as PyG's VirtualNode. |
TwoHop |
Adds the two-hop edges to the graph, as PyG's TwoHop. |
LineGraph |
Converts a graph to its line graph, as PyG's LineGraph. |
ToDense |
Converts the edges of a graph to a dense adjacency matrix, as PyG's ToDense. |
RemoveTrainingClasses |
Removes classes from the node-level training set given by train_mask, e.g. to build a zero-shot setting, as PyG's RemoveTrainingClasses. |