Git Product home page Git Product logo

Comments (8)

ngl567 avatar ngl567 commented on July 22, 2024

Hello, they are good questions.

  1. Actually, in L3, the confidence of Rules R1 β can be regarded as the Penalty coefficient. That is to say, the energy function E_3(r, r_e) consisting of a relation pair which are associated by a rule with lower confidence will contribute less for the loss function, and then it plays a smaller role in the process of parameters update by SGD. Wheras, the energy function E_3(r, r') is not generated by rules. Thus, β is employed for ensuring the effectiveness of using rules in our model.
  2. Because the third energy function is used to evaluate the similarity between two relations, you can just view loss function L_3 corresponding to E_3 as a regularization term in the optimization. So E_3 is only used in optimization procedure but not in testing.

from rpje.

Zawo1995 avatar Zawo1995 commented on July 22, 2024

Great job!Thanks for your patient explanation.

from rpje.

Zawo1995 avatar Zawo1995 commented on July 22, 2024

Sorry for reopening the issue.
I found the code in

double rel_pconfi = rel2rel[rel_a][i].second;

didn't use rel_pconfi (I thought it was the β).Could you explain why?

from rpje.

ngl567 avatar ngl567 commented on July 22, 2024

Thank you for pointing out this issue. Because there are too many versions of codes and I maybe uploaded an incomplete one. Now, I have fixed this issue. Please see the current version of the code.

from rpje.

Zawo1995 avatar Zawo1995 commented on July 22, 2024

Thanks for responsing so soon.
And sorry to consult you my issue again.
I guess the “while”hear is to find the neg_rel which is not satisfied R1and then gradient the negative sample,but in paper the r' just from T',no above mentioned constraint,this point mismatch the code hear.

while (rule_ok.count(make_pair(rel_a, rel_rneg)) > 0)

image
Could you explain why?

from rpje.

ngl567 avatar ngl567 commented on July 22, 2024

Thank you for this question. In our codes, we indeed randomly sample a rel_rneg which cannot match any R1 rule for constraining the relation embeddings.

from rpje.

Zawo1995 avatar Zawo1995 commented on July 22, 2024

Thanks a lot!
I think I know what you mean and the “while” here is to find the rel_neg.
But what confuse me is the equation[7] form paper,
Sorry for my poor English,I have to use Chinese to express my confusion here.

就,那个循环我知道是要找一个负关系r',这个r'不满足与关系rel_a的任何一条R1规则,这点,我理解。但是很奇怪的是,论文的公式7,它写的(r')∈T-这个很奇怪,因为公式8说T-是一个三元组的负例集合,而r'只是个关系啊,并且并没有代码里写的那么多的限制。

from rpje.

ngl567 avatar ngl567 commented on July 22, 2024

你说的很对,论文里给出的确实是负采样的方法,实际代码里会在负采样的基础上加上对不满足R1规则的关系的约束。

from rpje.

Related Issues (7)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.