pymc-devs / pymc-devs/pymc-examples

Pathfinder Variational Inference

Open
#776 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

proposal
Dominant language
Python
Stars
398
Forks
325
Avg merge
9d 15m
Merged PRs (30d)
1

Description

Notebook proposal

Title: Pathfinder Variational Inference

Why should this notebook be added to pymc-examples?

As the existing Pathfinder example notebook is really out-of-date, I propose replacement notebook to demo the new features from Pathfinder pymc-extras>=0.2.2 so that the user has a good understanding on:

  • How the algorithm works
  • Function argument recommendations
  • Compute speed and posterior comparisons between NUTS and ADVI
  • Interpreting the Pathfinder stdout results
  • (Maybe) How to use estimates from Pathfinder as initial values for NUTS
  • Pros and Cons of Pathfinder

Unlike ADVI, which in most cases, doesn't require users to think that deeply about setting the argument values and there being only a few arguments to consider, Pathfinder requires some extra more thought for many arguments. It can be highly sensitive to the argument values. And knowing how to set the argument values based on feedback from the stdout results and posterior visuals is going to help users understand adjustments they need to make on the argument values (before thinking this feature is broken or algorithm isn't effective).

Examples of function argument to discuss:
num_paths maxcor maxiter ftol gtol jitter importance_sampling compile_kwargs (if mode="JAX" is fixed), and inference_backend (if blackjax pathfinder is fixed)

Suggested categories:

  • Level: Intermediate
  • Diataxis type: Explanation & How-To Guide

Related notebooks

https://www.pymc.io/projects/examples/en/latest/variational_inference/pathfinder.html

References

Zhang, L., Carpenter, B., Gelman, A., & Vehtari, A. (2022). Pathfinder: Parallel quasi-Newton variational inference. Journal of Machine Learning Research, 23(306), 1–49.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reviewing the existing Pathfinder example at projects/examples/en/latest/variational_inference/pathfinder.html and compare it with the requested pymc-extras>=0.2.2 features. Replace the outdated example with a notebook covering the algorithm, argument guidance, NUTS and ADVI comparisons, stdout and posterior interpretation, and Pathfinder's pros and cons.

Written by the indexing model from the issue text.

Assessment

Tech stack
jupyter-notebook, python
Domain
documentation, machine-learning
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.