Skip to content

Commit

Permalink
GH-474: removed forward_labels_and_loss from nn.Model interface
Browse files Browse the repository at this point in the history
  • Loading branch information
aakbik committed Mar 14, 2019
1 parent 71a34ca commit 570657a
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions flair/models/sequence_tagger_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -256,14 +256,6 @@ def forward_loss(self, sentences: Union[List[Sentence], Sentence], sort=True) ->
features, lengths, tags = self.forward(sentences, sort=sort)
return self._calculate_loss(features, lengths, tags)

# def forward_labels_and_loss(self, sentences: Union[List[Sentence], Sentence],
# sort=True) -> (List[List[Label]], torch.tensor):
# with torch.no_grad():
# feature, lengths, tags = self.forward(sentences, sort=sort)
# loss = self._calculate_loss(feature, lengths, tags)
# tags = self._obtain_labels(feature, lengths)
# return tags, loss

def predict(self, sentences: Union[List[Sentence], Sentence],
mini_batch_size=32, verbose=False) -> List[Sentence]:
with torch.no_grad():
Expand Down

0 comments on commit 570657a

Please sign in to comment.