xyjigsaw / CENET

Temporal Knowledge Graph Reasoning with Historical Contrastive Learning
MIT License
69 stars 11 forks source link

why set some values to lambda or -lambda #18

Closed lihuiliullh closed 1 year ago

lihuiliullh commented 1 year ago

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

xyjigsaw commented 1 year ago

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: