Skip to content

Remove Pathfinder code example from docs #576

Closed
@penelopeysm

Description

@penelopeysm

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions