stanza
stanza copied to clipboard
Bias not used
Hi, it seems this bias weight in PairwiseBilinear
is not used. Possibly a (minor) bug?
https://github.com/stanfordnlp/stanza/blob/1c73418b65905b2d32f7b0dcb0bdd4a615b6ab0a/stanza/models/common/biaffine.py#L17
Thank you for pointing out! This is indeed a bug that we confirmed. However, we suppose this small bug might have little influence on model performance. We will figure it out and fix this in future release!
https://github.com/stanfordnlp/stanza/blob/e6c0b338ec7a5fdff422cb275ef7c448003e95f6/stanza/models/common/biaffine.py#L24-L29
Besides, I don't understand why intermediate tensor can view from (N x L1) x (D2 x O) to (N x (L1 x O) x D2) without transpose.
If I go to this line: https://github.com/stanfordnlp/stanza/blob/1c73418b65905b2d32f7b0dcb0bdd4a615b6ab0a/stanza/models/common/biaffine.py#L32
and add the bias, such as with
output = output + self.bias
I then retrained on a few datasets. One model got slightly better, one model stayed the same, and four got slightly worse. My conclusion is that the bias value isn't actually useful in this model.