Replies: 4 comments 14 replies
-
Sorry about not having updated the GraphSAGE unsupervised example yet. The current recommended approach is to use the
If you are interested, we can work together on upgrading the current |
Beta Was this translation helpful? Give feedback.
-
@rusty1s, I was playing around with
output: From what I understood from the documentation and your suggestions above, If the following is true, then I can calculate the loss function.
Where out, pos_out and neg_out are the corresponding quantities in Is it correct or am I missing something? Your help is highly appreciated. Thanks. |
Beta Was this translation helpful? Give feedback.
-
I also wonder how can I get the actual mini-batch nodes. I use |
Beta Was this translation helpful? Give feedback.
-
I just realized that for single vectors the definition of the inner product is the sum of the hadamard product |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Hi,
There are few similar questions on the forum, this question seems to be closest to what I am trying to do. But the answers provided there didn't really cleared up my doubts.
Here is my data:
In order to use GraphSage template, I have defined my own layer (extending the message-passing class) with a forward method that takes in (
x, edge_index, edge_attr
). Like others, I tried to mimic graph_sage_unsup.py but like others got stuck at replacingNeighborSampler
byNeighborLoader
.Now, I have couple of questions.
NeightborSampler
returns acomputational graph
for each node in the mini-batch, whileNeighborLoader
returns the actual subgraph. Here is an example of a mini-batch (of size 148) from runningNeighborLoader
:Data(x=[1361, 1433], edge_index=[2, 2630], y=[1361], train_mask=[1361], val_mask=[1361], test_mask=[1361], batch_size=148)
. From what I understand,data.edge_index[0,:148] contains the actual mini-batch nodes and the rest are sampled neighbors. Is that correct? If that is the case, I can get the
pos nodesand
neg nodesfor this mini-batch but in order to get their corresponding embeddings (to calculate the loss function), I need the subgraphs corresponding to these
pos nodesand
neg nodes`. At this point, I am not sure how to get these. Any way there?NeighborSampler
is being deprecated, we are changing toNeighborLoader
. But in the source code ofNeighborLoader
, i noticed that it is still usingneighbor_sampler
incollate_fn=self.neighbor_sampler
(here.I know it is a rather long question, but I have spent considerable time (~2 month since I started reading on GNNs) on it and would like to use the GraphSage template for my data because it seems to fit our need the most.
But if there is another graph neural net that I could use in my scenario, please let me know.
Any help would be highly appreciated.
Beta Was this translation helpful? Give feedback.
All reactions