learning-hmm 0.3.1.1 → 0.3.1.2
raw patch · 4 files changed
+12/−9 lines, 4 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES.md +3/−0
- learning-hmm.cabal +1/−1
- src/Learning/HMM/Internal.hs +4/−4
- src/Learning/IOHMM/Internal.hs +4/−4
CHANGES.md view
@@ -1,6 +1,9 @@ Revision history for Haskell package learning-hmm === +## Version 0.3.1.2+- Default the limit of Baum-Welch iteration to 10000 (in `baumWelch'`)+ ## Version 0.3.1.1 - Bug fix release
learning-hmm.cabal view
@@ -1,5 +1,5 @@ name: learning-hmm-version: 0.3.1.1+version: 0.3.1.2 stability: experimental synopsis: Yet another library for hidden Markov models
src/Learning/HMM/Internal.hs view
@@ -146,12 +146,12 @@ (models, logLs) = unzip $ iterate step (model, undefined) baumWelch' :: HMM -> U.Vector Int -> (HMM, LogLikelihood)-baumWelch' model xs = go (undefined, -1/0) (baumWelch1 model n xs)+baumWelch' model xs = go (10000 :: Int) (undefined, -1/0) (baumWelch1 model n xs) where n = U.length xs- go (m, l) (m', l')- | l' - l > 1.0e-9 = go (m', l') (baumWelch1 m' n xs)- | otherwise = (m, l')+ go k (m, l) (m', l')+ | k > 0 && l' - l > 1.0e-9 = go (k - 1) (m', l') (baumWelch1 m' n xs)+ | otherwise = (m, l') -- | Perform one step of the Baum-Welch algorithm and return the updated -- model and the likelihood of the old model.
src/Learning/IOHMM/Internal.hs view
@@ -152,12 +152,12 @@ (models, logLs) = unzip $ iterate step (model, undefined) baumWelch' :: IOHMM -> U.Vector (Int, Int) -> (IOHMM, LogLikelihood)-baumWelch' model xys = go (undefined, -1/0) (baumWelch1 model n xys)+baumWelch' model xys = go (10000 :: Int) (undefined, -1/0) (baumWelch1 model n xys) where n = U.length xys- go (m, l) (m', l')- | l' - l > 1.0e-9 = go (m', l') (baumWelch1 m' n xys)- | otherwise = (m, l')+ go k (m, l) (m', l')+ | k > 0 && l' - l > 1.0e-9 = go (k - 1) (m', l') (baumWelch1 m' n xys)+ | otherwise = (m, l') -- | Perform one step of the Baum-Welch algorithm and return the updated -- model and the likelihood of the old model.