Skip to content

Commit

Permalink
Bugfix in positional embedding, not used in main baselines
Browse files Browse the repository at this point in the history
  • Loading branch information
simsa-st committed Mar 8, 2023
1 parent 1007461 commit 051b01d
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions baselines/NER/my_roberta_multilabel.py
Original file line number Diff line number Diff line change
Expand Up @@ -192,9 +192,9 @@ def forward(
w = r - l
h = b - t
pos2_cx_emb = self.pos2_cx_emb((cx / self.quant_step_size + 0.5).int())
pos2_cy_emb = self.pos2_cx_emb((cy / self.quant_step_size + 0.5).int())
pos2_w_emb = self.pos2_cx_emb((w / self.quant_step_size + 0.5).int())
pos2_h_emb = self.pos2_cx_emb((h / self.quant_step_size + 0.5).int())
pos2_cy_emb = self.pos2_cy_emb((cy / self.quant_step_size + 0.5).int())
pos2_w_emb = self.pos2_w_emb((w / self.quant_step_size + 0.5).int())
pos2_h_emb = self.pos2_h_emb((h / self.quant_step_size + 0.5).int())

pos2_emb = pos2_cx_emb + pos2_cy_emb + pos2_w_emb + pos2_h_emb

Expand Down

0 comments on commit 051b01d

Please sign in to comment.