ShulinCao / OpenNRE-PyTorch

Neural Relation Extraction implemented in PyTorch
MIT License
219 stars 45 forks source link

Why set two embedding tables for attention? #12

Closed LifangD closed 5 years ago

LifangD commented 5 years ago

您好,想请教一下为什么attention的设置中既有relation_matrix 又有attention_matrix呢?论文里或者别的一些实现里只用了一个relation 的embedding, e,g: image

ShulinCao commented 5 years ago

你可以试下,其实两个效果差别不大,原论文里其实是relation和query各一个matrix

LifangD commented 5 years ago

确实应该差不多,您是说这里的r 和 M 不是来自同一个matrix ? 还有您的code里面attention matrix 想要表达的是A? 不知道为什么这里的weighted diagonal matrix A 其他实现好像也没有特别强调... image image @ShulinCao

ShulinCao commented 5 years ago

按论文里,有一个M和一个A,r是来自M

LifangD commented 5 years ago

thx~~