pub fn forward<O, M: Model<O>>(
hmm: &M,
observations: &[O]
) -> (Array2<LogProb>, LogProb)
Expand description
Execute the forward algorithm and return the forward probabilites as LogProb
values
and the resulting forward probability.
§Arguments
hmm
- theModel
to run the forward algorithm onobservations
- a slice of observation values to use in the algorithm
§Result
The resulting pair (P, p) is the forward probability table (P[[s, o]]
is the entry
for state s
and observation o
) and the overall probability for observations
(as
LogProb
).
§Type Parameters
O
- the observation typeM
- typeModel
type