tweag / chainsail

Replica Exchange sampling as-a-service
MIT License
11 stars 1 forks source link

Complete tempered likelihood implementation #373

Closed simeoncarstens closed 1 year ago

simeoncarstens commented 2 years ago

Currently, Chainsail supports only a single family of tempered distributions, namely the Boltzmann distribution / canonical ensemble-like $p(x|\beta) \propto p(x)^\beta$. To make Chainsail more appealing for Bayesian statistics use cases, we want to support a similar tempered distribution family, but that only applies a temperature to the likelihood of a posterior distribution. This looks as follows:

$$ p(x|D, \beta) \propto p(D|x)^\beta p(x) $$

I started implementing this a while ago: we already have a class LikelihoodTemperedPosterior, defined in https://github.com/tweag/resaas/blob/main/lib/common/chainsail/common/tempering/tempered_distributions.py#L108 that implements this family of distributions.

To make this fully work, the following things have to be taken care of (roughly in order):

At this point, you should be able to run the controller locally (https://github.com/tweag/resaas/blob/main/app/controller/README.md#L30), specifying your new tempered distribution family in a job.json file.

A final step is then changing the front-end JavaScript code (https://github.com/tweag/resaas/blob/main/app/client/pages/job.js) to add a dropdown field that allows the user to choose between the existing Boltzmann tempered distribution and the likelihood-tempered distribution in the job submission form.

simeoncarstens commented 1 year ago

All done via #377 and #383.