Replies: 1 comment
|
You do not necessarily need a sparse-matrix type to keep graph convolution at A Keras layer can gather source-node features, compute messages, and aggregate them with Conceptually: src, dst = edge_index[0], edge_index[1]
messages = keras.ops.take(node_features, src, axis=0)
aggregated = keras.ops.segment_sum(
messages, dst, num_segments=keras.ops.shape(node_features)[0]
)Then add normalization, self-loops, and a learned projection according to the exact GCN formulation. For batches of graphs, concatenate their nodes and offset each graph's edge indices, while retaining a graph-id vector for pooling. There is no single sparse tensor abstraction whose storage, autograd, and supported kernels are identical across TensorFlow, JAX, and PyTorch. Using a backend-native sparse tensor therefore gives up some portability. Edge-list message passing built from |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Hi everyone,
Motivation
I describe very briefly what I'd like to do (related to OP.), question is at the bottom.
Here is a very well cited and simple paper (40K) for convolutions on graphs (I'd like to use it for chemistry.)
Torch Geometric
It would be easy with Torch Geometric (PyG):
I want to use Keras for multi backend.
The formula in the paper seems trivial to implement in a layer:
but they talk about linear increase of complexity with the number of edges, surely this is due to sparse matrices.
Question 0: Yet, it seems Sparse Tensors support still on queue?
Question 1: We need to re-implement the graph-like layers to get multi-backend, right ? Otherwise one would just PyG.
Question 2: Can one use such sparse representations in pure Keras, chaging then the backend ? I can't find a tutorial or ref, apart from TF itself here.
All reactions