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 dtype long.

Return type:

Tensor

Returns:

A tensor of shape [sequence_length], returning the log-probability of each

sequence.