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:
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.
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):
BoltzmannInitialScheduleParametersSchema
can be reused,initial_schedule_parameters
field in theJobSpec
(https://github.com/tweag/resaas/blob/main/lib/common/chainsail/common/spec.py#L301),tempered_distribution_family
to the constructors in https://github.com/tweag/resaas/blob/main/app/controller/chainsail/controller/__init__.py#L126 / https://github.com/tweag/resaas/blob/main/app/controller/chainsail/controller/__init__.py#L385 and make a field that holds its value,JobSpec
to the controller (e.g., in https://github.com/tweag/resaas/blob/main/app/controller/chainsail/controller/run_local.py#L83),_config_template_from_params
in https://github.com/tweag/resaas/blob/main/app/controller/chainsail/controller/__init__.py#L279 and add it to the job config dictionary in that function,rexfw
runner, replace the hardcoding of theBoltzmannTemperedDistribution
(https://github.com/tweag/resaas/blob/main/lib/runners/rexfw/chainsail/runners/rexfw/mpi.py#L210) by a choice of the correct tempered distribution based on the config file entry.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.