Adding the addition of the two sentence orderings in similarity head.

This commit is contained in:
Grégory Châtel
2018-07-13 17:26:32 +02:00
parent ea7f5006d5
commit ac2250881a
+1
View File
@@ -259,6 +259,7 @@ class SimilarityHead(nn.Module):
flat = x[..., 0].contiguous().view(-1)
sim_h = sim_h[flat == self.clf_token, :]
sim_h = self.dropout(sim_h)
sim_h = sim_h.sum(dim = 1)
sim_logits = self.linear(sim_h)
return sim_logits