HazyResearch/KGEmb

bug in Givens-reflection?

owenyoung75 opened this issue · 1 comments

Hi,

I just noticed there seems to be a bug in Givens-reflection function at:
https://github.com/HazyResearch/KGEmb/blob/master/utils/euclidean.py#L60

The current code is:
x_ref = givens[:, :, 0:1] * torch.cat((x[:, :, 0:1], -x[:, :, :1]), dim=-1) + givens[:, :, 1:] * torch.cat( (x[:, :, 1:], x[:, :, 0:1]), dim=-1)
which I thought should be:
x_ref = givens[:, :, 0:1] * torch.cat((x[:, :, 0:1], -x[:, :, 1:]), dim=-1) + givens[:, :, 1:] * torch.cat( (x[:, :, 1:], x[:, :, 0:1]), dim=-1)

Thanks for the catch, this should be fixed now!