RepositoryC++THThailand
lawmurray

lawmurray/Birch

A probabilistic programming language that combines automatic differentiation, automatic marginalization, and automatic conditioning within Monte Carlo methods.

126stars
14forks
3issues
3views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: autodiff

#1 Repository of the month

1
TINIX TRENDING·Topic: probabilistic-programming-languages

#1 Repository of the month

1
TINIX TRENDING·Topic: monte-carlo-sampling

#1 Repository of the month

Birch

Birch is a probabilistic programming language featuring automatic marginalization, automatic conditioning, automatic differentiation, and inference algorithms based on Sequential Monte Carlo (SMC). The Birch language transpiles to C++.

See https://birch-lang.org for a gentle introduction, and https://docs.birch-lang.org for reference documentation.

lawmurray codecov

License

Birch is open source software. It is licensed under the Apache License, Version 2.0 (the "License"); you may not use it except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0.

Getting started

Binary packages may be available for your system, see the website. If not, or if you have special requirements, you can install Birch from source. This requires:

  • GNU autoconf, automake, libtool, flex, and bison
  • LibYAML
  • Eigen

The following is optional but recommended for significant performance improvements, and will be linked in automatically if found:

All Birch sources are in the same repository. Clone it:

git clone https://github.com/lawmurray/Birch.git

and change to the Birch directory:

cd Birch

Then proceed as follows. Note special instructions for Mac in step 2. In addition, on Mac, you can typically omit sudo from these commands.

  1. Install MemBirch by running, from within the membirch/ directory:

    ./bootstrap
    ./configure
    make
    sudo make install
    
  2. Install NumBirch by running, from within the numbirch/ directory:

    ./bootstrap
    ./configure
    make
    sudo make install
    
  3. Install Birch by running, from within the birch/ directory:

    ./bootstrap
    ./configure
    make
    sudo make install
    
  4. Install the Birch standard library by running, from within the libraries/Standard/ directory:

    birch build
    sudo birch install
    

This constitutes a basic install. You can inspect the different components for advanced options, such as disabling assertions to improve performance, or building the CUDA backend for NumBirch. You may also like to install other packages in the libraries/ directory. It is not usual to install the packages in the examples/ directory, although you may like to build and run these locally for learning purposes.

Similar Projects

Discover other similar projects and AI models.

RepositoryC++
stan-dev/stan

Stan development repository. The master branch contains the current release. The develop branch contains the latest stable development. See the Developer Process Wiki for details.

2.8k
Dec 1, 2026
RepositoryJulia
tpapp/DynamicHMC.jl

Implementation of robust dynamic Hamiltonian Monte Carlo methods (NUTS) in Julia.

253
Oct 29, 2026
RepositoryTeX
avehtari/BDA_course_Aalto

Bayesian Data Analysis course at Aalto

2.3k
Nov 24, 2026
RepositoryR
stan-dev/shinystan

shinystan R package and ShinyStan GUI

201
Sep 28, 2026
RepositoryR
stan-dev/loo

loo R package for approximate leave-one-out cross-validation (LOO-CV) and Pareto smoothed importance sampling (PSIS)

160
Nov 27, 2026
RepositoryC++
nimble-dev/nimble

The base NIMBLE package for R

200
Aug 31, 2026
RepositoryPython
pyro-ppl/pyro

Deep universal probabilistic programming with Python and PyTorch

9.1k
Oct 5, 2026
RepositoryJulia
TuringLang/Turing.jl

Bayesian inference with probabilistic programming.

2.3k
Nov 24, 2026
RepositoryJupyter Notebook
pymc-devs/pymc-resources

PyMC educational resources

2.1k
Dec 23, 2024