Skip to content

Commit

Permalink
Indicate that the forward-backward method is not used
Browse files Browse the repository at this point in the history
  • Loading branch information
allanj committed Mar 30, 2020
1 parent 25bd85c commit 9438ba5
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions model/linear_crf_inferencer.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ def backward(self, lstm_scores: torch.Tensor, word_seq_lens: torch.Tensor) -> to

def forward_backward(self, lstm_scores: torch.Tensor, word_seq_lens: torch.Tensor) -> torch.Tensor:
"""
Note: This function is not used unless you want to compute the marginal probability
Forward-backward algorithm to compute the marginal probability (in log space)
Basically, we follow the `backward` algorithm to obtain the backward scores.
:param lstm_scores: shape: (batch_size, sent_len, label_size) NOTE: the score from LSTMs, not `all_scores` (which add up the transtiion)
Expand Down

0 comments on commit 9438ba5

Please sign in to comment.