awslabs / dgl-ke

High performance, easy-to-use, and scalable package for learning large-scale knowledge graph embeddings.
https://dglke.dgl.ai/doc/
Apache License 2.0
1.28k stars 196 forks source link

Error when running the example of wn18_weighted #242

Closed yi-oscer closed 2 years ago

yi-oscer commented 3 years ago

Hi,

I tried to run the example of "wn18_weighted", but had the following error:

File "....../dgl-ke-master/python/dglke/models/pytorch/loss.py", line 80, in get_total_loss neg_loss = self._get_neg_loss(neg_score) * edge_weight RuntimeError: The size of tensor a (128) must match the size of tensor b (2048) at non-singleton dimension 1

Should "neg_loss = self._get_neg_loss(neg_score) edge_weight" be changed to "neg_loss = ((self._get_neg_loss(neg_score).T) edge_weight).T"?