MarkovChainModel.forward¶
- MarkovChainModel.forward(sequences: Tensor) Tensor [source]¶
- MarkovChainModel.forward(sequences: PackedSequence) Tensor
Computes the log-probability of observing each of the provided sequences.
- Parameters:
sequences -- Tensor of shape
[num_sequences, sequence_length]
or a packed sequence. Packed sequences should be used whenever the sequence lengths differ. All sequences must contain state indices of dtypelong
.- Return type:
- Returns:
- A tensor of shape
[sequence_length]
, returning the log-probability of each sequence.
- A tensor of shape