Running tgn.py on a small dataset #7249
Replies: 2 comments 15 replies
-
You need to define data = TemporalData(
src=torch.tensor([1, 2, 3, 4, 5, 6, 7, 8, 9, 10]),
dst=torch.tensor([22, 33, 44, 55, 66, 77, 88, 99, 100, 111]),
t=torch.tensor([0, 10, 20, 30, 40, 50, 60, 70, 80, 90]),
msg=Tensor([1, 1, 0, 0, 0, 1, 2, 3, 2, 1])
)
data = data.to(device) |
Beta Was this translation helpful? Give feedback.
-
This is in relation to the thread above and relates to training the model in The questions are in the bullet points. I have a dataset stored in a .csv file for now. A small example to illustrate my issue is as shown below:
As it can be noted, the dataset corresponds to a small graph with 4 nodes and 4 edges. Each node is endowed with a node feature and each edge carries two edges features. The timestamps of the temporal edges are all set to 0 as this is the initial graph. The next set of data which is stored in another .csv contains edges with timestamps set to 1 as the edge features are set to evolve at every
Here are my node features (volume) and edge features (surface_tension and L2_norm) (just a simple example based on the given small dataset above):
I now proceed to define my temporal data:
I have looked in Thanks for any help in advance! |
Beta Was this translation helpful? Give feedback.
-
I am trying to run the
tgn.py
file on a small dataset shown below in order to understand how things work with this particular temporal GNN.Here is the data:
I have not change anything in the code except that I exclude the train/test/val_loader part as the above dataset is small.
I end up with the following error:
IndexError: tensors used as indices must be long, byte or bool tensors
at the linen_id, edge_index, e_id = neighbour_loader(n_id)
in the training loop.I am not sure how to correct this.
For the sake of clarity here is the whole script:
Thanks in advance for the help!
Beta Was this translation helpful? Give feedback.
All reactions