TorchSpatiotemporal / tsl

tsl: a PyTorch library for processing spatiotemporal data.
https://torch-spatiotemporal.readthedocs.io/
MIT License
236 stars 22 forks source link

Imputation: change number of nodes after training #9

Closed ucsky closed 1 year ago

ucsky commented 1 year ago

Hello,

Is it possible to change the number of node after training. For example I have trained an Imputer with 180 channel and 4 nodes. Can I perform inference with data that have 180 channel and 5 nodes?

marshka commented 1 year ago

Hi, the general answer is yes, as generic GNNs can handle varying topologies. This cannot be the case when your model has also node-dependent components, for instance, node identifiers (e.g., StaticGraphEmbedding in tsl). In those cases, there are workarounds you can choose (e.g., you can set a maximum number of nodes and then select the identifiers/embeddings of the only nodes you are considering in that forward pass).