Изменения

Перейти к: навигация, поиск

Алгоритм Баума-Велша

402 байта добавлено, 01:19, 22 декабря 2014
Псевдокод
== Псевдокод ==
'''DynamicOptionalStateSequance'''(<tex>\lambda</tex>, D): a'''double''' <tex>\gamma</tex>[1, i] = <tex>\pi</tex>[i]*b[i, d[1]] '''int''' <tex>\psi</tex>[1, i] = [] '''int''' ans[]
'''for''' t = 2 '''to''' T
'''for''' i = 1 '''to''' n
a '''if''' <tex>\gamma</tex>[t, j] += a< <tex>\gamma</tex>[t- 1, i]*a[i, j] * b[j, d[t]] <tex>\gamma</tex>[t, j] = <tex>\gamma</tex>[t - 1, i] * a[ti, j] *= b[j, d[t + 1]] <tex>\psi</tex>[t, j] = i ans[T] = 1 '''for''' i = 1 2 '''to''' n p(D| '''if''' <tex>\lambdagamma</tex>[T, i] > <tex>\gamma</tex>) += a[T, i- 1] ans[T] = i '''for''' t = T - 1 '''downto''' 1 ans[t]= <tex>\psi</tex>[t + 1, ans[t + 1]] '''return''' ans
== Источники ==
50
правок

Навигация