TuringLang / SSMProblems.jl

Common abstractions for state-space models
http://turinglang.org/SSMProblems.jl/
MIT License
2 stars 2 forks source link

Add an example on particle filtering / particle Gibbs #43

Open yebai opened 1 month ago

yebai commented 1 month ago

It would be good to have a simple example of particle filtering. The previous version depends on AdvancedPS; we could remove that dependency to keep this minimal.

https://github.com/TuringLang/SSMProblems.jl/tree/8a458bd2941d38e75932683f9dc994d5dd80c47c/examples/smc

FredericWantiez commented 1 month ago

I don't think it depends on AdvancedPS but happy to rewrite it with the new interface

yebai commented 1 month ago

That sounds good.

A fun experiment: You can even try vectorising the particle sampling process to see whether it works well with Metal.jl.

THargreaves commented 1 month ago

Just a heads up about Metal.jl. I ran a few benchmarks with it on my M1 Mac and found that even for easily parallelisable functions such as sum(), it ran the same speed as on the CPU.

Still an interesting experiment but don't be surprised if it feels slow.

yebai commented 1 month ago

M-chips seem to have good support for vectorisation, so I won't be surprised that sum works comparably on CPU and Metal. Do you benchmark anything more substantial?