https://docs.dgl.ai/en/latest/api/python/dgl.dataloading.html#negative-samplers-for-link-prediction
Want to sampler (negative sampler~ ) for link prediction at bipartite graph(non-asymmetric graph)
i didn’t understand dgl.dataloading.negative_sampler.Uniform(k) 's parameters;
conceretly, how can i adapt my graph at proper the call module(g,eids) ?!
In my graph attribute is here,
g.nodes(’_U’)
return tensor([…])
g.nodes(’_P’)
return tensor([…])
g_m2.edges()
return tensor([…])
return tensor([…])
graph
Graph(num_nodes={’_U’: 11268, ‘_P’: 1664},
num_edges=({’_U’, ‘_B’, ‘_P’}): 323897},
metagraph={(’_U’, ‘_P’, ‘_B’})
then my question
g_m2 is my graph data
neg_samler = dgl.dataloading.negative_sampler.Uniform(2)
neg_sampler(g_m2, [0, 91])
Error message ; ‘list’ object has no attribute ‘shape’
and thus try that
list(zip(g.edges()[0] , g.edges()[1]))[0]
→ src, dst edge [0]
then happen same
what could i input them properthem?