IvanYashchuk / fenics-pymc3

Differentiable interface to FEniCS for PyMC3
MIT License
20 stars 3 forks source link

SMC Sampling #1

Open hanzy1110 opened 3 years ago

hanzy1110 commented 3 years ago

Hi @IvanYashchuk! I recently encountered your library and wanted to thank you for the implementation its come quite handy for a problem we are tackling here at my Uni. However I'm having the following problems:

IvanYashchuk commented 3 years ago

Hi @hanzy1110! I haven't tried the SMC sampler and don't know how it works. Thanks for reporting that it doesn't work! Possibly some changes are needed to create_fenics_theano_op so that broadcasting is supported. I don't have an immediate solution to fix that.

By multiple cores do you mean running the PyMC3 sampler with cores=N or running with MPI via mpirun -n N python fenics_script.py? I guess you're talking about cores=N, I've noticed that sometimes the program hangs if N > 1 used. I didn't investigate further and haven't fixed that. What this parameter does is simply duplicating the sampler with a different random seed, so a workaround for this is to run the program multiple times (sequentially or using GNU parallel) with different random seeds save the different chains and then load with ArviZ for example to calculate the diagnostics that require multiple chains.

hanzy1110 commented 3 years ago

Thanks for your answer! I will try your solution for the multiple cores problem but I lack enough knowledge about the innards of pymc and fenics to edit create_fenics_theano_op. Anything I should look for to start tinkering with it?