Created
July 11, 2018 14:56
-
-
Save Terryhung/5cbb116de4b09a150da0bfa5e4d4841d to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def forward(self, feature): | |
for f in feature: | |
f = torch.from_numpy(f) | |
f = f.float() | |
lstm_out, self.hidden = self.lstm( | |
f.view(1, 1, len(f)), self.hidden) | |
tag_space = self.hidden2tag(lstm_out.view(1, self.hidden_dim)) | |
tag_scores = F.log_softmax(tag_space, dim=1) | |
return tag_scores |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment