benedekrozemberczki / pytorch_geometric_temporal

PyTorch Geometric Temporal: Spatiotemporal Signal Processing with Neural Machine Learning Models (CIKM 2021)
MIT License
2.62k stars 369 forks source link

Can this library use mini-batch training? #162

Closed hsuankai closed 2 years ago

hsuankai commented 2 years ago

My situation is that I have a bunch of fixed structured graphs. e.g. X.shape = (320, 640, 4, 128) # samples x time x num_nodes x features, and their edges are same. I am wondering if I can do mini-batch training like batch size 32 and the shape of batch_X is (32, 640, 4, 128). I've seen the documentation and example, but I think it is not implemented for those graph temporal layers. Did I miss something? My imagination is like:

batch_X = torch.rand((640, 32, 4, 128)) # time x batch x num_nodes x features
model = DCRNN(128, 256, 1)
for x in batch_X:
    x_t = model(x, edge_index) # the shape of x_t (32, 4, 256)

But it seems not doable.

iakovts commented 2 years ago

Hey, have you found any way to do that ? I've actually run into a similar problem, posted a question about that on stackoverflow here.