Haskell implementations of Hidden Markov Models & related algorithms from AIMA book
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

WIP: Cost-HMM algorithms from the paper

+22
+22
src/cHMM.hs
··· 1 + {-# LANGUAGE DataKinds #-} 2 + {-# LANGUAGE TypeOperators #-} 3 + {-# LANGUAGE RankNTypes #-} 4 + {-# LANGUAGE TypeApplications #-} 5 + 6 + module CHMM where 7 + 8 + import Prelude(undefined) 9 + import Papa 10 + 11 + import GHC.TypeNats 12 + import Data.Proxy 13 + import Linear.V 14 + import Combinatorics 15 + import qualified Data.Vector as Vec 16 + 17 + ----------------------- 18 + 19 + trajectory :: forall n t a . (KnownNat n, KnownNat t) => Proxy t -> V n a -> V (n ^ t) (V n a) 20 + trajectory p = V . Vec.fromList . fmap (V . Vec.fromList) . variateRep t . toList 21 + where 22 + t = fromIntegral $ natVal p