From 9fee1178d55a593baab37d33659720f1d88f9d99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20B=C3=A4renz?= Date: Thu, 11 May 2023 17:25:09 +0200 Subject: [PATCH] Clean up SSM benchmark --- benchmark/SSM.hs | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/benchmark/SSM.hs b/benchmark/SSM.hs index aa1a8898..c57c8dcb 100644 --- a/benchmark/SSM.hs +++ b/benchmark/SSM.hs @@ -1,5 +1,6 @@ module Main where +import Control.Monad (forM_) import Control.Monad.Bayes.Inference.MCMC import Control.Monad.Bayes.Inference.PMMH as PMMH (pmmh) import Control.Monad.Bayes.Inference.RMSMC (rmsmcDynamic) @@ -18,15 +19,7 @@ main :: IO () main = sampleIOfixed $ do dat <- generateData t let ys = map snd dat - liftIO $ print "SMC" - smcRes <- runAlgFixed ys SMC - liftIO $ print smcRes - liftIO $ print "RM-SMC" - smcrmRes <- runAlgFixed ys RMSMCDynamic - liftIO $ print smcrmRes - liftIO $ print "PMMH" - pmmhRes <- runAlgFixed ys PMMH - liftIO $ print pmmhRes - liftIO $ print "SMC2" - smc2Res <- runAlgFixed ys SMC2 - liftIO $ print $ show smc2Res + forM_ [SMC, RMSMCDynamic, PMMH, SMC2] $ \alg -> do + liftIO $ print alg + result <- runAlgFixed ys alg + liftIO $ putStrLn result