Modify just some nodes embeddings based in index

Hi, everyone.

I’m following the graph sage approach for link prediction: 5.3 Link Prediction — DGL 0.6.1 documentation

My graph is homogeneous, one link type, one node type.

My question is: could I just sage some part of the nodes during training? I have 80000 nodes, but I would need to modify node embeddings from index 40000 to 80000.

Is this possible?

Thanks.

It suffices to remove all the incoming edges of nodes with index 0 to 39999, so their embeddings will never be updated by message passing. You also need to properly set self-loops or residual connections for them.

Since all my origin nodes are from 0 index to 40000, and all my destination nodes are from 40000 to 80000, I dont need to remove any edge, right?

Sorry, but I dont fully understand this part.

Thank you so much.

Since all my origin nodes are from 0 index to 40000, and all my destination nodes are from 40000 to 80000, I dont need to remove any edge, right?

Yes

Sorry, but I dont fully understand this part.

With AX for message passing, where A is the adjacency matrix and X is the node feature matrix, nodes without incoming edges will have a full-zero feature. You need to carefully handle that.

All my nodes from 40000 to 80000 have al leats one incoming edge, so this doesn´t affect them, right? Or maybe it does, since the origin nodes from those edges didn’t have themselves upcoming edges?

Sorry for the late reply. If your GNN has more than one GNN layers, then you do need to have self-loops or residual connections for nodes from 0 to 39999.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.