pymc-devs / pymc

Bayesian Modeling and Probabilistic Programming in Python
https://docs.pymc.io/
Other
8.67k stars 2k forks source link

Sequential Monte Carlo -- Using Theano? #548

Closed raddy closed 8 years ago

raddy commented 10 years ago

I'm aware of this pymc2 wrapping SMC library: https://github.com/ebilionis/pysmc

Is SMC utilizing Theano on the roadmap for pymc? This would presumably require all of the particle motion/initialize functions be theano-ified. (Which seems daunting)

ebilionis commented 10 years ago

Is anybody willing to help me port pysmc on pymc 3?

The aim of pysmc is to sample from posteriors with very very expensive likelihoods (from 30 seconds to a few hours for a single evaluation possibly requiring many cpu's for a single evaluation). These appear in the process of calibrating scientific models on real data. The technical issues are the following: 1) we need to be able to run in parallel on a wide array of different architectures in parallel 2) we must be able to make use of non-theano functions (e.g. the output of an existing scientific program, this relates to a previous post on this mailing list).

The documentation of the current version is here: http://ebilionis.github.io/pysmc/

In the Appendix of the attached "smc_paper.pdf", I describe the Sequential Monte Carlo technique in detail when applied to sampling from posteriors. Note that this is quite different from the application of Sequential Monte Carlo to dynamical models.

Perks:

Don't hesitate to contact me.

Ilias Bilionis

On Fri, Jun 6, 2014 at 4:48 PM, Josh notifications@github.com wrote:

I'm aware of this pymc2 wrapping SMC library: https://github.com/ebilionis/pysmc

Is SMC utilizing Theano on the roadmap for pymc? This would presumably require all of the particle motion/initialize functions be theano-ified. (Which seems daunting)

— Reply to this email directly or view it on GitHub https://github.com/pymc-devs/pymc/issues/548.

Ilias Bilionis, Mathematics and Computer Science Division, Argonne National Laboratory, Lemont, IL http://www.mcs.anl.gov/~ebilionis/

fonnesbeck commented 10 years ago

This is pretty cool, Ilias. I'm teaching a tutorial on Bayesian computing at SciPy next month, and I may include some pysmc as part of it.

As for PyMC 3, we are always here to help with integration, the problem is that the core PyMC 3 developers are each pretty busy, to the point that we barely have time to move PyMC 3 forward. The other devs can speak for themselves, but I have not been able to set aside much development time in the past several months, mainly due to the fact that my schedule is busy and nobody is paying me to develop PyMC. I'm trying to line up a grant for next year to remedy this, but for the moment, that is the situation. So, I'm intrigued by the possibility of faculty/postdoc funding that you propose. Feel free to forward any details.

twiecki commented 10 years ago

I second everything @fonnesbeck said. https://github.com/pymc-devs/pymc/issues/507 is the issue on adding arbitrary stochastics. Theano made the necessary change but we haven't yet added an example for this.

aflaxman commented 10 years ago

@ebilionis: What version of PyMC does pysmc work with now? I tried your tutorial with PyMC 2.3.2 and got AttributeError: 'Metropolis' object has no attribute 'get_params' when calling smc_sampler.initialize(0.01). It looks like very cool stuff, though.

ebilionis commented 10 years ago

@aflaxman: Which example are you trying to run? This problem is described (somewhat) here: https://github.com/ebilionis/pysmc/issues/2

It has to do with this:

Thus, for the moment, most of the examples are broken. You would have to manually assign step methods, like this: mcmc.use_step_method(pysmc.RandomWalk, model['mixture'])

You need to assign one of these step methods:

This example should work: https://github.com/ebilionis/pysmc/blob/master/examples/simple_model_run.py It should be fairly obvious how you can make the rest of the examples work (until I have the time to fix the issue or the examples).

aflaxman commented 10 years ago

Cool, that works for me! I was trying to follow the tutorial here when I had trouble.

twiecki commented 10 years ago

@ebilionis Are you still interested? I think the necessary pieces are in place now and it shouldn't be too hard to port.

ebilionis commented 10 years ago

Of course I am. However, it will have to wait until the end of September because it is the busiest period of the year for me right now. I will get back to you when I find some time.

Ilias Bilionis

Assistant Professor Department of Mechanical Engineering Purdue University

On Aug 17, 2014, at 4:00 PM, Thomas Wiecki notifications@github.com wrote:

@ebilionis Are you still interested? I think the necessary pieces are in place now and it shouldn't be too hard to port.

— Reply to this email directly or view it on GitHub.

jsalvatier commented 9 years ago

Have you had a chance to look at this at all?

SemanticBeeng commented 9 years ago

@twiecki, all: please share an update on this.

Doing some time series state space modeling research from Time Series: Modeling, Computation, and Inference and need Sequential Monte Carlo.

State Space Models in R mentions what can be done with R but I would really like to use Pymc 3 as well if at all possible.

[UPDATE]: Found https://twitter.com/twiecki/status/479308176207388673.

springcoil commented 8 years ago

Is it worth closing this issue? I've not seen any activity for over a year.

twiecki commented 8 years ago

Yes I think so.

On Sep 3, 2016 7:53 PM, "Peadar Coyle" notifications@github.com wrote:

Is it worth closing this issue? I've not seen any activity for over a year.

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/pymc-devs/pymc3/issues/548#issuecomment-244560493, or mute the thread https://github.com/notifications/unsubscribe-auth/AApJmGDkUW6Hb1amyYg5o-h-GpAI_SbBks5qmbQGgaJpZM4CB_St .

hvasbath commented 7 years ago

Lol now I see this ... It is done @ebilionis ; ) . Of course would be great to get your input on it...