Open 13717630148 opened 3 years ago
Currently, Node2Vec
cannot handle edge weights, so you will need to convert your data to the form of a regular edge_index
in PyG of shape [2, num_edges]
(holding only the source and destination node pair, dropping the edge weight).
so the first row represents the source and the second row represents the destination? and i can repeat one edge to n times,where n equals to its weight, to create a weighted graph?
Indeed, weighted graphs can be simulated by replicating edges, although it comes at the expense of a higher memory consumption.
ive got edges and coresponding weights in the following form: [(x1,y1,w1),...] where x represents the departure point,y represents the destination and w represents the weight of the edge. but now i dont know how to transform my data to replace 'data.edge_index' in node2vec.py. i dont know what form is 'data.edge_index',since im not allowed to connect the server to the Internet and i cant download it also,it seems that node2vec.py runs on undirected graph? im a junior,andwaiting for your reply!thanks