SIGN
¶
SIGN(K: int)
Bases: BaseTransform
Precomputes the propagated node features of the Scalable Inception
Graph Neural Network (SIGN) from "SIGN: Scalable Inception Graph Neural Networks", as PyG's SIGN:
for \(i \in \{ 1, \ldots, K \}\), stored in the attributes x1,
x2, ... xK. \(\mathbf{D}\) is the weighted in-degree, the
edge_weights attribute is used as \(\mathbf{A}\) if it exists, and
no self-loops are added. Messages flow from the source to the
destination of each edge.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
K
|
int
|
Number of hops. |
required |
Example:
graph = GraphData(
edge_index=mx.array([[0, 1], [1, 0]]),
node_features=mx.array([[1.0], [2.0]]),
)
graph = SIGN(K=2)(graph)
graph.x1, graph.x2
# mx.array([[2.0], [1.0]]), mx.array([[1.0], [2.0]])
Methods:
| Name | Description |
|---|---|
process |
Adds the propagated node features |
process
¶
Adds the propagated node features x1 ... xK to data.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
data
|
GraphData
|
The graph to transform. |
required |
Returns:
| Type | Description |
|---|---|
GraphData
|
The graph with the propagated features. |
Source code in mlx_graphs/transforms/propagation.py
from mlx_graphs.transforms import SIGN · mlx_graphs/transforms/propagation.py