EdGENetworks / attention-networks-for-classification

Hierarchical Attention Networks for Document Classification in PyTorch
603 stars 132 forks source link

Sentence model bug when GRU are not bidirectional #12

Closed gabrer closed 6 years ago

gabrer commented 6 years ago

A small bug does not allow to train the network when Bidirectional is set to False.

In "model.py", on line 135, Bidirectional should be set to "False": Line 135

From: self.sent_gru = nn.GRU(word_gru_hidden, sent_gru_hidden, bidirectional= True) to: self.sent_gru = nn.GRU(word_gru_hidden, sent_gru_hidden, bidirectional= False)

Sandeep42 commented 6 years ago

Thanks for finding this out, I have updated the code to reflect this change.