elfi-dev / elfi

ELFI - Engine for Likelihood-Free Inference
http://elfi.readthedocs.io
BSD 3-Clause "New" or "Revised" License
262 stars 60 forks source link

Processing failed simulations / samples #433

Open aejarvin opened 1 year ago

aejarvin commented 1 year ago

I am using BOLFI for optimization of a relatively complicated plasma physics code. These plasma simulations tend to sometimes become unstable, which then leads to a collapse of the sample collection step. At the moment, I simply deal with this by having an exception handling in the run script: try: bolfi.fit(n_evidence=#samples) except: bolfi.batches.reset()

However, this is a bit of an unsophisticated way and a more preferred solution would be to avoid the bolfi.batches.reset() step, continue running the rest of the batch, and just store the input parameters with which the simulations fail for later inspection for simulation failure characteristics. Is there already a way conduct this type of failure handling in ELFI/BOLFI?

hpesonen commented 1 year ago

Hi, unfortunately there's no such error handling in the current releases available. However, I have something like that available on my own local fork. It has not been tested throughly yet, but I could make the branch available if that would be helpful?

aejarvin commented 1 year ago

Hi. That sounds great! Really the point of my questions was to survey a bit on whether this has been implemented by someone already so that I can contribute to rather improve an existing implementation than create a parallel branch. Thanks!