pymc-devs/pymc

Compute only dependent logp in step samplers

Open

#7.591 geöffnet am 26. Nov. 2024

Auf GitHub ansehen
 (0 Kommentare) (0 Reaktionen) (0 zugewiesene Personen)Python (1.902 Forks)batch import
enhancementshelp wantedsamplers

Repository-Metriken

Stars
 (7.926 Stars)
PR-Merge-Metriken
 (Durchschn. Merge 11T 6h) (12 gemergte PRs in 30 T)

Beschreibung

Description

As discussed in: https://discourse.pymc.io/t/semantik-description-of-kruschke-diagrams-model-to-graphviz/16142/8 we could be making more use of the conditional partition of the logp graph for partial step samplers.

When the proposal depends on a ratio between probabilities (BinaryMetropolois, BinaryGibbsMetropolis, CategoricalGibbsMetropolis, Slice, NUTS), we don't need to compute terms that don't depend on the updated variables.

Step samples that explicitly request delta_logp (Metropolis, DEMetropolis) achieve this implicitly via PyTensor rewrites.

I suggest adding a model.dependent_logp(vars) that helps us get the logp we need (the variables of interest + conditional dependent variables)

Contributor Guide