PPL Bench
Evaluation Framework for Probabilistic Programming Languages
Key Features
Modular
Plug in new models and new Probabilistic Programming Language implementations of the models.
Using Predictive Log Likelihood
Using the Predictive Log Likelihood metrics makes PPLBench applicable for all types of PPLs.
Reusable
Write a benchmark workflow once, reuse it across all PPLs.
Get started in seconds
1. Install PPL Bench with supported PPLs:
pip install 'pplbench[ppls]'2. Write a simple JSON config
Let's store the following config into a file called
example.json
.{"model": {"class": "logistic_regression.LogisticRegression","args": {"n": 2000,"k": 5,"rho": 3}},"iterations": 500,"trials": 2,"ppls": [{"name": "stan","inference": {"class": "inference.VI","infer_args": {"algorithm": "meanfield"}},"legend": {"color": "red","name": "stan-VI-mean"}},{"name": "stan","inference": {"class": "inference.MCMC"},"legend": {"color": "blue"}}],"save_samples": true}3. Run PPL Bench:
pplbench example.jsonYou should see the plots like followings in the output directory:
pll.png
pll_half.png
4. Try PPL Bench with other configs
The
examples
directory in our GitHub repo provides a list of config files to show how PPL Bench could be used. Let's tryexamples/logistic_regression.json
to see the performance across different PPLs:(You'll need to install Jags first before running this config)
pplbench examples/logistic_regression.jsonThe plots shoule look like the followings:
pll.png
pll_half.png
To see the schema of the config file used by PPL Bench
pplbench -hTo learn more about PPL Bench
Read our Introduction