Check in MP-CNN Lite Model (#108)

* Add MP-CNN Lite model

* MP-CNN Lite bug fixes
This commit is contained in:
Michael Tu
2018-05-25 00:15:50 -04:00
committed by GitHub
parent d7a631b0a9
commit 0c3a91c443
3 changed files with 122 additions and 2 deletions
+1 -1
View File
@@ -216,7 +216,7 @@ class MPCNN(nn.Module):
attention_emb2 = torch.cat((attention_weighted_sent2, sent2), dim=1)
return attention_emb1, attention_emb2
def forward(self, sent1, sent2, ext_feats=None, word_to_doc_count=None, raw_sent1=None, raw_sent2=None, sent1_nonstatic=None, sent2_nonstatic=None):
def forward(self, sent1, sent2, ext_feats=None, word_to_doc_count=None, raw_sent1=None, raw_sent2=None):
# Attention
if self.attention != 'none':
sent1, sent2 = self.concat_attention(sent1, sent2, word_to_doc_count, raw_sent1, raw_sent2)