Closed barkincavdaroglu closed 1 year ago
Solved. Problem is that DataLoader is returning data in random order.
Not exactly true. While shuffle was true (and data was being returned in random order everytime), the problem was with using tensor.scatter_. Resolved with torch.gather.
Currently, we construct padded neighborhoods of nodes sorted by edge weights to pass into LSTM as follows:
This is incredibly inefficient since we are using for-loops. Number of nodes per graph is 207, and our batch size is usually either 64 or 128, hence we loop for either 13248 or 26496 times. It is possible to form padded neighborhoods using:
But it doesn't sort using edge weights. A quick play-around:
However there is a bug with this approach that I cannot figure out.