shenwzh3 / RGAT-ABSA

MIT License
213 stars 51 forks source link

您的代码在定义self.gat_dep时直接用的list没有用nn.ModuleList,这导致self.gat_dep的参数不训练 #9

Open xingbowen opened 3 years ago

xingbowen commented 3 years ago

我发现您的代码在定义self.gat_dep时直接用的list没有用nn.ModuleList, 我查了一些文档,发现这会导致self.gat_dep的参数不会参与训练,只会参加forward计算。 于是我进行了实验,我在训练前后打印self.gat_dep的参数,发现没有变化,但是实验结果与您的论文中差不多。 请问在你那里运行时有没有这个情况? 为什么初始化self.gat_dep的参数后它的参数从未参与训练只参与了forward过程还能得到比较好的结果?

circle-hit commented 3 years ago

我也想问同样的问题。但当我把代码中定义self.gat_dep时换成使用nn.ModuleList后,结果反而有所下降。