xyjigsaw / CENET

Temporal Knowledge Graph Reasoning with Historical Contrastive Learning

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

why set some values to lambda or -lambda

lihuiliullh opened this issue · comments

May I know the purpose of the following code in model.forward()?

s_history_tag[s_history_tag != 0] = self.args.lambdax
o_history_tag[o_history_tag != 0] = self.args.lambdax

s_non_history_tag[s_history_tag == 1] = -self.args.lambdax
s_non_history_tag[s_history_tag == 0] = self.args.lambdax

o_non_history_tag[o_history_tag == 1] = -self.args.lambdax
o_non_history_tag[o_history_tag == 0] = self.args.lambdax

s_history_tag[s_history_tag == 0] = -self.args.lambdax
o_history_tag[o_history_tag == 0] = -self.args.lambdax

Thank you for your interest in our work, the codes aims to generate historical and non-historical dependency for copy-mechanism. You can find it Section3.2. The illustration is shown as follows: