laplace
Laplacian
Bases: MessagePassing
Matrix-free uniform graph Laplacian.
The operator uses the random-walk form of the uniform Laplacian:
Lx = x - mean(neighbour_values).
Source code in src/torch_structure/message_passing/laplace.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 | |
dense_matrix()
Materialize the operator as a dense matrix when a solver needs it.
Source code in src/torch_structure/message_passing/laplace.py
29 30 31 32 33 34 | |
forward(x)
Apply the Laplacian operator: x - mean(neighbour_values).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
x
|
torch.Tensor [N, *]
|
per-node values. |
required |
Returns:
| Type | Description |
|---|---|
|
torch.Tensor [N, *]: the Laplacian of |
Source code in src/torch_structure/message_passing/laplace.py
17 18 19 20 21 22 23 24 25 26 27 | |
message(x_j)
Pass each neighbour's value through unchanged, to be mean-aggregated.
Source code in src/torch_structure/message_passing/laplace.py
36 37 38 | |