We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 17b8b4d commit e15580cCopy full SHA for e15580c
beginner_source/nlp/advanced_tutorial.py
@@ -277,14 +277,12 @@ def _viterbi_decode(self, feats):
277
return path_score, best_path
278
279
def neg_log_likelihood(self, sentence, tags):
280
- self.hidden = self.init_hidden()
281
feats = self._get_lstm_features(sentence)
282
forward_score = self._forward_alg(feats)
283
gold_score = self._score_sentence(feats, tags)
284
return forward_score - gold_score
285
286
def forward(self, sentence): # dont confuse this with _forward_alg above.
287
288
# Get the emission scores from the BiLSTM
289
lstm_feats = self._get_lstm_features(sentence)
290
0 commit comments