We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
论文里公式13第二部分主要这样的:Ir - EtRE 代码里似乎对应(因为论文里kge损失的权重λ2和代码里kge_weight的默认值都是0.01)
self.kge_loss = 0 for hop in range(self.n_hop): h_expanded = tf.expand_dims(self.h_emb_list[hop], axis=2) t_expanded = tf.expand_dims(self.t_emb_list[hop], axis=3) hRt = tf.squeeze(tf.matmul(tf.matmul(h_expanded, self.r_emb_list[hop]), t_expanded)) self.kge_loss += tf.reduce_mean(tf.sigmoid(hRt)) self.kge_loss = -self.kge_weight * self.kge_loss
代码里应该就是h * r * t,然后我有以下几个疑问: 1、公式里Ir怎么对应,是0矩阵么?否则我不明白kge_loss为何是要在kge_weight和kge_loss相乘结果的基础上,再乘个-1。但是Ir的定义是
Ir is the slice of the indicator tensor I in KG for relation r
也就是Ir是关系r在知识图谱里用I切的片,这里I张量是怎么定义的呢?
2、公式里参数用的是λ2/2,但是代码里却是kge_weight,这里是代码手误么?
希望大佬能在百忙之中尽快解答,谢谢。
The text was updated successfully, but these errors were encountered:
你好!
Sorry, something went wrong.
我看论文也发现了,还好找到了这里~感谢解答!
No branches or pull requests
论文里公式13第二部分主要这样的:Ir - EtRE
代码里似乎对应(因为论文里kge损失的权重λ2和代码里kge_weight的默认值都是0.01)
代码里应该就是h * r * t,然后我有以下几个疑问:
1、公式里Ir怎么对应,是0矩阵么?否则我不明白kge_loss为何是要在kge_weight和kge_loss相乘结果的基础上,再乘个-1。但是Ir的定义是
也就是Ir是关系r在知识图谱里用I切的片,这里I张量是怎么定义的呢?
2、公式里参数用的是λ2/2,但是代码里却是kge_weight,这里是代码手误么?
希望大佬能在百忙之中尽快解答,谢谢。
The text was updated successfully, but these errors were encountered: