MarkovChain.score

MarkovChain.score(sequences)[source]

Computes the average negative log-likelihood (NLL) of observing the provided sequences. If you want to have NLLs for each individual sequence, use score_samples() instead.

Parameters

sequences (Union[ndarray[Any, dtype[float32]], Tensor, Dataset[Tensor]]) -- The sequences for which to compute the average log-probability.

Return type

float

Returns

The average NLL for all sequences.

Note

See score_samples() to obtain the NLL values for individual sequences.