Lion-ZS / GIE

20 stars 2 forks source link

Question for the hypersphere space #10

Open ukjung21 opened 10 months ago

ukjung21 commented 10 months ago
  1. I think that the following exponential map and logarithmic map in your paper is only for the poincare ball, which is a model of hyperbolic geometry. image But you are using them for both the hyperbolic space and hypersphere space.

  2. Hyperbolic space has negative curvature and hypersphere space has positive curvature, however there is no such distinction for the sign of curvature. c1 = F.softplus(self.c1[queries[:, 1]]) c2 = F.softplus(self.c2[queries[:, 1]]) Rather it seems that the value of kappa is fixed into a positive value as it goes through the activation function, so that the both embeddings are fixed in hyperbolic space.

  3. Finally, the predicted tail that should be similar to the true tail is embedded into poicare ball.

    lhs = expmap0(att_q, c)
    rel, _ = torch.chunk(self.rel(queries[:, 1]), 2, dim=1)
    rel = expmap0(rel, c)
    res = project(mobius_add(lhs, rel, c), c)

    Then, can I assume that the entities are eventually embedded in hyperbolic space?

Could you please answer for the above three issues? If I'm right, can you give me some analysis of why it's performing so well despite the implementation being different from the theory?

Lion-ZS commented 10 months ago

Thank you for your attention. There are some misunderstandings in the previous version of the code. I have uploaded a new one and hope this can help you.

At 2024-01-21 14:16:47, "ukjung21" @.***> wrote:

I think that the following exponential map and logarithmic map in your paper is only for the poincare ball, which is a model of hyperbolic geometry. image.png (view on web) But you are using them for both the hyperbolic space and hypersphere space.

Hyperbolic space has negative curvature and hypersphere space has positive curvature, however there is no such distinction for the sign of curvature. c1 = F.softplus(self.c1[queries[:, 1]]) c2 = F.softplus(self.c2[queries[:, 1]]) Rather it seems that the value of kappa is fixed into a positive value as it goes through the activation function, so that the both embeddings are fixed in hyperbolic space.

Finally, the predicted tail that should be similar to the true tail is embedded into poicare ball.

lhs = expmap0(attq, c) rel, = torch.chunk(self.rel(queries[:, 1]), 2, dim=1) rel = expmap0(rel, c) res = project(mobius_add(lhs, rel, c), c)

Then, can I assume that the entities are eventually embedded in hyperbolic space?

Could you please answer for the above three issues? If I'm right, can you give me some analysis of why it's performing so well despite the implementation being different from the theory?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.Message ID: @.***>

ukjung21 commented 10 months ago

Thank you for your response. However, there is one thing that I'm still confuse.

att_q = torch.sum(att_weights * cands, dim=1)
lhs = expmap0(att_q, c)
rel, _ = torch.chunk(self.rel(queries[:, 1]), 2, dim=1)
rel = expmap0(rel, c)
res = project(mobius_add(lhs, rel, c), c)

If I look at the code above, att_q is in Euclidean space and we map att_q into hyperbolic space with curvature c using expmap0. Thus, I thought this code finally embeds the entity in hyperbolic space. Is it right?

Lion-ZS commented 10 months ago

Thank you for your attention. Yes, on top of the geometry interaction, here we add expmap0(·) aiming to form a more approximate spatial structure like the real world for the interactive space.

At 2024-02-01 23:06:37, "ukjung21" @.***> wrote:

Thank you for your response. However, there is one thing that I'm still confuse.

att_q=torch.sum(att_weights*cands, dim=1) lhs=expmap0(attq, c) rel, =torch.chunk(self.rel(queries[:, 1]), 2, dim=1) rel=expmap0(rel, c) res=project(mobius_add(lhs, rel, c), c)

IfIlookatthecodeabove, att_qisinEuclideanspaceandwemapatt_qintohyperbolicspacewithcurvaturecusingexpmap0. Thus, Ithoughtthiscodefinallyembedstheentityinhyperbolicspace. Isitright?

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you commented.Message ID: @.***>