pymc-devs/pymc

Compute only dependent logp in step samplers

開放

#7,591 建立於 2024年11月26日

 (0 則留言) (0 個反應) (0 位負責人)Python (1,902 個分叉)batch import
enhancementshelp wantedsamplers

倉庫指標

星標
 (7,926 顆星)
PR 合併指標
 (PR 指標待抓取)

描述

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)

貢獻者指南