Pass weight_attr to NeighborLoader for HeteroData object #8290
Replies: 4 comments 1 reply
-
Would do you mean by performing weighted sampling via node features? Weighted sampling is done based on a single weight vector that holds a weight for each edge, e.g: data.edge_weight = ...
loader = NeighborLoader(data, weight_attr='edge_weight') |
Beta Was this translation helpful? Give feedback.
-
I want every node to have a certain weight which is one of my node feature as well. So, for example if there are 3 nodes n1, n2, n3 with these weight as w1, w2 and w3 respectively (which are one of the node feature as well) and assume all the nodes the are connected to the remaining 2 nodes. Then, during neighbour sampling for node n1, I want to give a weightage of w2 for sampling n2 and w3 for sampling n3. Similarly, while sampling for node n2, I want to give a weightage of w1 for sampling n1 and w3 for sampling n3, and so on for n3. |
Beta Was this translation helpful? Give feedback.
-
In the way it has been implemented, I think my need could be accomplished by setting the edge weight as the multiplication of weights of the connecting nodes, am I right here? |
Beta Was this translation helpful? Give feedback.
-
@rusty1s I am experiencing very high training times on using weight_attr, is this expected? Do you have any training duration benchmarking for this feature? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I want to have weighted sampling of neighbours on a heterograph (using different node features for different node types). How should I pass weight_attr argument to the NeighborLoader for this?
Also, weight_attr expects a string input but the HeteroData object does not store the node feature names, then how is this expected to be passed? In my opinion this should be passed as a map of node type and respective feature index.
Beta Was this translation helpful? Give feedback.
All reactions