Code Monkey home page Code Monkey logo

guillemot's Introduction

Guillemot

Guillemot is a probabilistic programming language designed for binary, discrete, and discretized continuous distributions (continuous distributions are not supported). It supports both exact (direct search) (except when including multiplication, division, or exponentiation operations, or weighted least squares regression) and approximate (random sampling) inference.

Additonally, Guillemot allows commands to marginalize expressions (including variables) or eliminate certain remaining variables, improving program runtime.

Guillemot logo

Assumptions

  1. Properly formatted Guillemot program as input.
  2. A return statement must occur within the program.

Supported operations

  1. Logical operators:

    • Equality (==)
    • Not equality (!=)
    • Greater than (>)
    • Greater than or equal (>=)
    • Greater than (>)
    • Greater than or equal (>=)
  2. Arithmetic operations:

    • Addition (A + B)
    • Substraction (A - B)
    • Multiplication (A * B)
    • Division (A / B)
    • Exponentiation (A ** B)
    • Opposite (- A)
  3. Variable calculation operations:

    • Expectation
    • Variance
  4. Variable types supported:

    • Binary (implemented internally as a discrete numeric)
    • Discrete:
      • Numeric: Each state must be a number, either an integer or a float
      • Qualitative: Each state must be a string
    • Continuous (discretized), the following distributions are supported:
      • Beta
      • Gaussian (Normal)
      • Pareto
      • Uniform
  5. Search space reduction

    • Expression marginalization
    • Variable elimination
  6. Show circuit

  7. Weighted Least Squares Regression

Setup

Guillemot can be used directly from this directory or through Docker. Both are described below:

  1. Direct setup

Guillemot can be used directly after cloning this directory via:

git clone https://github.com/noderod/Guillemot.git

Enter the directory:

cd Guillemot/

If not already installed, the following python3 libraries are required:

  • matplotlib
  • numpy
  • scipy

These may be installed via (may require sudo access):

pip3 install matplotlib numpy scipy

Run Guillemot on a .glmt file (use the -T flag after the filename to show the time in miliseconds):

alias guillemot="python3 main.py"

# Exact inference (direct search)
guillemot enumerate benchmarks/truck_engine.glmt

# Approximate inference (random sampling)
guillemot rejection benchmarks/truck_engine.glmt
  1. Docker setup

Note: Docker images do not have GUI access, so the circuit cannot be shown. All other commands work as expected.

Build image using Docker, this step may require sudo access:

docker build -t guillemot/guillemot:latest .

Enter the image (note, the container will be deleted after exiting), this step may require sudo access:

docker run -it --rm guillemot/guillemot:latest bash

Run a provided benchmark (use the -T flag after the filename to show the time in miliseconds):

# Exact inference (direct search)
guillemot enumerate benchmarks/truck_engine.glmt

# Approximate inference (random sampling)
guillemot rejection benchmarks/truck_engine.glmt

Examples

Multiple examples are provided within the benchmarks/ directory.

References

Available in references.md as well as in the code. In the case of a code piece utilized multiple times but only used from another resource once (e.g. a stack overflow reference), only the first time is mentioned.

guillemot's People

Contributors

noderod avatar

Stargazers

Daniel Bruno avatar Chiantine P. Manigos avatar めぐみ発動機 (isVowel / GreenWing) avatar

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.