This tutorial intoduces the use of FEniCS for solving differentiable variational problems in PyMC3.
Automatic adjoint solvers for FEniCS programs are generated with dolfin-adjoint/pyadjoint. These solvers make it possible to use Theano's (PyMC3 backend) reverse mode automatic differentiation with FEniCS.
Here is the link to the static (non-interactive) version of the tutorial: https://ivanyashchuk.github.io/fenics_pymccon2020/
This tutorial assumes that you have Anaconda (Python 3.7 version) setup and installed on your system.
The next step is to clone or download the tutorial materials in this repository. If you are familiar with Git, run the clone command:
git clone https://github.com/IvanYashchuk/fenics_pymccon2020.git
otherwise you can download a zip file of its contents, and unzip it on your computer.
The repository for this tutorial contains a file called environment.yml
that includes a list of all the packages used for the tutorial. If you run:
conda env create -f environment.yml
from the main tutorial directory, it will create the environment for you and install all of the packages listed. This environment can be enabled using:
conda activate fenics_pymc3_tutorial
Then, I recommend using JupyterLab to access the materials (tutorial.ipynb
):
jupyter lab