Safe Haskell | None |
---|---|
Language | Haskell2010 |
This module provides a simple way to train the transition matrix and initial probability vector using simple patterns of state sequences.
You may create a trained model using semigroup combinators like this:
example :: HMM.DiscreteTrained Char (ShapeStatic.ZeroBased TypeNum.U2) Double example = let a = atom FL.i0 b = atom FL.i1 distr = Distr.DiscreteTrained $ Map.fromList $ ('a', ShapeStatic.vector $ 1!:2!:FL.end) : ('b', ShapeStatic.vector $ 4!:3!:FL.end) : ('c', ShapeStatic.vector $ 0!:1!:FL.end) : [] in finish (ShapeStatic.ZeroBased Proxy) distr $ replicate 5 $ replicate 10 a <> replicate 20 b