Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove Pathfinder code example from docs #576

Closed
penelopeysm opened this issue Jan 16, 2025 · 1 comment
Closed

Remove Pathfinder code example from docs #576

penelopeysm opened this issue Jan 16, 2025 · 1 comment

Comments

@penelopeysm
Copy link
Member

Pathfinder.jl is lovely, but we probably shouldn't have a code example in there:

```{julia}
using AdvancedHMC, Pathfinder
# Running pathfinder
draws = 1_000
result_multi = multipathfinder(model, draws; nruns=8)
# Estimating the metric
inv_metric = result_multi.pathfinder_results[1].fit_distribution.Σ
metric = DenseEuclideanMetric(Matrix(inv_metric))
# Creating an AdvancedHMC NUTS sampler with the custom metric.
n_adapts = 1000 # Number of adaptation steps
tap = 0.9 # Large target acceptance probability to deal with the funnel structure of the posterior
nuts = AdvancedHMC.NUTS(tap; metric=metric)
# Sample
chain = sample(model, externalsampler(nuts), 10_000; n_adapts=1_000)
```

Rationale:

  1. We want the docs to use the most recent version of Turing.jl, as far as is possible. Pathfinder is the only reverse dep of Turing that we are using*, meaning that if we release a new version of Turing, we need Pathfinder to also release a new version that is compatible with it. We shouldn't expect Pathfinder's maintainers to do this (they may not want to, for whatever reason).

  2. We shouldn't be responsible for documenting how another package is used. It's great to point out other packages in the Julia ecosystem that can be used together with Turing, but the question of how to use package X should be documented in package X. Indeed, Pathfinder's docs already contain an example that is remarkably similar to our own: https://mlcolab.github.io/Pathfinder.jl/stable/examples/turing/

* There's also TuringBenchmarking, but that's internal, so we can easily tag a new release whenever we need to.

@penelopeysm
Copy link
Member Author

Closed by #579

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant