ttrouill / complex

Source code for experiments in the papers "Complex Embeddings for Simple Link Prediction" (ICML 2016) and "Knowledge Graph Completion via Complex Tensor Factorization" (JMLR 2017).
Other
319 stars 83 forks source link

Question about concatenation in extract_sub_scores function. #6

Closed gsp2014 closed 6 years ago

gsp2014 commented 6 years ago

Hi Théo,

I wonder if this line https://github.com/ttrouill/complex/blob/61fa3f6bf424aa284b467977317d0f7f17647d3a/efe/evaluation.py#L88 should be "res = Result(res.preds[idxs], res.true_vals[idxs], res.ranks[np.concatenate((idxs, len(idxs)+idxs))], res.raw_ranks[np.concatenate((idxs, len(idxs)+idxs))])". That is, add len(idxs) to the concatenation.

Thanks a lot.

ttrouill commented 6 years ago

Indeed it should be this, will fix asap, thanks!

ttrouill commented 6 years ago

Actually no! Because idxs is a boolean array that has the same size as res.ranks, and is equal to True at the indexes to extract, so the correct code is indeed np.concatenate((idxs,idxs)).

Sorry for the latency and the wrong first reply :/

gsp2014 commented 6 years ago

Yes, it's my fault. Thanks for your patience!