diff options
Diffstat (limited to 'src/PPL/Sampling.hs')
-rw-r--r-- | src/PPL/Sampling.hs | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/PPL/Sampling.hs b/src/PPL/Sampling.hs index 1d20838..b3b8a90 100644 --- a/src/PPL/Sampling.hs +++ b/src/PPL/Sampling.hs @@ -25,8 +25,8 @@ importance n m = do cumsum = tail . scanl (+) 0 accumulate = uncurry zip . second cumsum . unzip -mh :: MonadIO m => Double -> Meas a -> m [(a, Log Double)] -mh p m = do +mh :: MonadIO m => Double -> Double -> Meas a -> m [(a, Log Double)] +mh p q m = do newStdGen g <- getStdGen let (g1, g2) = split g @@ -37,7 +37,7 @@ mh p m = do step (t, x, w) = do g <- get let (g1, g2) = split g - t' = mutateTree p g1 t + t' = mutateTree p q g1 t (x', w') = head $ samples m t' ratio = w' / w (Exp . log -> r, g3) = random g2 |