Trainable feature extractor

I have a heterogeneous graph and in my task, each node is a set of points (each node has a different number of points). So I need a trainable feature extractor to process the point set of each node and provide a generate a feature vector with a same length per each node.
my problem is that (1) because of having various number of points per each node, I can’t load my data in DGL graph at the first and (2) how can I add a trainable feature extractor per each note type to be trained with tho whole?

as a summmary:
node 1:
type: polyline
feature: [13, 10]

node 2:
type: polyline
feature: [17, 10]

and I don’t want to use a pretrained feature extractor

How can I handle that?

Is it possible to aggregate the sequence for every node with an LSTM before feeding it into a GNN?

Hey, thanks for your prompt reply,
It could be, but with 2 concerns:

(1) I need a trainable feature extractor (like LSTM you mentioned), so in dataloader how can I load my data into graph format while nodes with same types has various shapes?

(2) In my case, each node actually is a FC graph. I want to first get a trainable feature extractor to generate feature vector for them and second have a global graph on the feature vectors. So how can I load my data in graph format? (I have some edges in subgraphs and some edges on feature vector of subgraphs) and a I’m a little confused about how should I load my data in the dgl graph at first?

it could be like this modelling (the right side graph is not a FC one necessarily and it will be a heterograph)

Screenshot from 2022-11-10 09-29-36

You need to store the features outside the graph. Currently DGL graphs assume that the node features have the same shape.

This sounds like a “nested” graph. I think in this case you likely need to write your own Dataset and/or DataLoader object depending on how your data is organized. May I know how your data is organized so I could give more advices? Like. does each of your “inner” FC graph have features? Are different nodes with the same node type have different FC graphs or different “inner node features”?