yzhangcs / crfpar

[ACL'20, IJCAI'20] Code for "Efficient Second-Order TreeCRF for Neural Dependency Parsing" and "Fast and Accurate Neural CRF Constituency Parsing".
https://www.aclweb.org/anthology/2020.acl-main.302
MIT License
76 stars 7 forks source link

关于论文Efficient Second-Order TreeCRF for Neural Dependency Parsing中的式子 #9

Closed ldsheng1998 closed 1 year ago

ldsheng1998 commented 1 year ago

您好,我想请教论文中与打分triaffine结构相关张量的shape形状

Snipaste_2023-10-26_22-34-38

具体来说是我想请问: 您的论文中有说W(triaffine)的shape为(dxdxd),我想知道剩余三个部分的shape是怎样的,进而了解这三部分r(i),r(k),r(j)是如何与三阶的权重张量W进行相乘的。 期待您的回答,谢谢您!

yzhangcs commented 1 year ago

@ldsheng1998 Hi, 代码里我提供了一点注释 https://github.com/yzhangcs/parser/blob/main/supar/modules/affine.py#L227-L260

具体来说三个r都是d * d,方便计算会concat到大的W

ldsheng1998 commented 1 year ago

谢谢你我浏览了代码之后明白了您是如何计算的了