Did you know ... Search Documentation:
Packs (add-ons) for SWI-Prolog

Package "ccprism"

Title:Probabilistic programming using delimited continuations
Rating:Not rated. Create the first rating!
Latest version:0.1.0
SHA1 sum:925c66a57430ea3877bbc1d9caa283b7e1f686b9
Author:Samer Abdallah <s.abdallah@ucl.ac.uk>
Download URL:https://github.com/samer--/ccprism.git
Requires:dcgutils
genutils
plrand
typedef

Reviews

No reviews. Create the first review!.

Details by download location

VersionSHA1#DownloadsURL
0.1.0576e6e48cbdef02ccc9459e99b79484b0c5b4b381https://github.com/samer--/ccprism.git
12405ecf39e64758dfe8dac2f77961279890918b1https://github.com/samer--/ccprism.git
925c66a57430ea3877bbc1d9caa283b7e1f686b941https://github.com/samer--/ccprism.git
0.0.105a4e06827fdab67f91e9535d42ffdcfaf1bffd611https://github.com/samer--/ccprism.git
452b1085ffc2565786c984694981981bf849e5791https://github.com/samer--/ccprism.git
2477f99b5c9c1c55dfbccadc0fbc858bd86b07351https://github.com/samer--/ccprism.git
0271579a1a46e0aef6d5d8c61d6bd3b07cd1df471https://github.com/samer--/ccprism.git
b3a584046d185f9103c015fe73d3a894198e3cbc2https://github.com/samer--/ccprism.git
aefb0b78de7118346bae26259bf21adcf3a66ec03https://github.com/samer--/ccprism.git
c70f9f6f86d99f55e5950693a08b83ab2f133d4e1https://github.com/samer--/ccprism.git
0.0.9eadf6857bc3021e7eb083e83ca3664d8ddbac2111https://github.com/samer--/ccprism.git
0.0.8a326b68665e39231e320774016ed9e39194c0c462https://github.com/samer--/ccprism.git
ae6a113a78355fbb018b90e83d6f877690b55cc02https://github.com/samer--/ccprism.git
0.0.71a4ceee7599b8d1ae55c4531802573251796947a1https://github.com/samer--/ccprism.git
ff94bb9b8522124b24f7b9055707277ef417d5832https://github.com/samer--/ccprism.git
0.0.6e7e52f59bd91b0bd4428a7a80ec8935a76c9d8901https://github.com/samer--/ccprism.git
0.0.56fbba4c64941fcd3ea2f20a1e72d9eee1bed5b5a1https://github.com/samer--/ccprism.git
0.0.4b0a25dd09a39c7be33d14f2cb26ec9ddcde09b2e1https://github.com/samer--/ccprism.git
0.0.3c64a9373da9da237b25d796f7ede7a603dea1bc51https://github.com/samer--/ccprism.git
0.0.2bdee1c67c3d2559fadd4690988e31ff6dc58518f1https://github.com/samer--/ccprism.git
0.0.1bbaad8168f14aff527607bb246a0162eb2bc39e61https://github.com/samer--/ccprism.git

ccprism: Probabilistic programming as a library using delimited control

This package provides several services for working with probabilistic models and is based on the functionality of PRISM. Models are written as Prolog programs enriched with extra computational effects: probabilistic choice and tabling. Programs can be run in sampling mode or explanation mode. Explanation mode results in a hypergraph representing the computation, which can then be processed to get:

  • inside probabilities (generalised sum-product algorithm)
  • the single best explanation (generalised Viterbi algorithm)
  • any number of explanations in order of probability (lazy k-best algorithm)
  • outside probabilities for computing parameter sufficient statistics Based on these several EM parameter learning methods are provided: maximum likelihood, maximum a posterior, variational Bayes, and Viterbi learning. Deterministic annealling can be used with all of these methods.

    A couple of MCMC explanation sampling methods are also provided.

Usage Examples

You can load the test module included in the examples directory like this:

swipl -g 'consult(pack(ccprism/examples/test))'

More information on how to use the system to follow... NB. the test module requires the memo pack to be installed.

There are also other examples, including lazy.pl which shows how another layer of state can be used to get lazy samplers and thereby implement random world semantics, and crp.pl, which is an experiment in implementing Dirichlet processes (fairly inefficiently) using CRPs on top of ccprism.

Note on tabling implementations

Earlier versions used a tabling implementation where non-backtrackable state was stored using services from the ccnbenv library module. This was replaced with a trie-based data structure (see https://github.com/samer--/cctable) which is a lot faster. However, in doing so, we lost the ability to store attributed variables in the variant and solution tries. The old version is still available in the branch old_tabling_with_attributes.

Contents of pack "ccprism"

Pack contains 57 files holding a total of 187K bytes.