Skip to content

Commit 6ff478a

Browse files
jessegrabowskiricardoV94
authored andcommitted
Correct stats_dtypes_shapes is CategoricalGibbsMetropolis
1 parent 4bf18b2 commit 6ff478a

File tree

1 file changed

+4
-10
lines changed

1 file changed

+4
-10
lines changed

pymc/step_methods/metropolis.py

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -680,7 +680,6 @@ def competence(var):
680680
class CategoricalGibbsMetropolisState(StepMethodState):
681681
shuffle_dims: bool
682682
dimcats: list[tuple]
683-
tune: bool
684683

685684

686685
class CategoricalGibbsMetropolis(ArrayStep):
@@ -763,10 +762,6 @@ def __init__(
763762
else:
764763
raise ValueError("Argument 'proposal' should either be 'uniform' or 'proportional'")
765764

766-
# Doesn't actually tune, but it's required to emit a sampler stat
767-
# that indicates whether a draw was done in a tuning phase.
768-
self.tune = True
769-
770765
if compile_kwargs is None:
771766
compile_kwargs = {}
772767
super().__init__(vars, [model.compile_logp(**compile_kwargs)], blocked=blocked, rng=rng)
@@ -796,10 +791,8 @@ def astep_unif(self, apoint: RaveledVars, *args) -> tuple[RaveledVars, StatsType
796791
if accepted:
797792
logp_curr = logp_prop
798793

799-
stats = {
800-
"tune": self.tune,
801-
}
802-
return q, [stats]
794+
# This step doesn't have any tunable parameters
795+
return q, [{"tune": False}]
803796

804797
def astep_prop(self, apoint: RaveledVars, *args) -> tuple[RaveledVars, StatsType]:
805798
logp = args[0]
@@ -816,7 +809,8 @@ def astep_prop(self, apoint: RaveledVars, *args) -> tuple[RaveledVars, StatsType
816809
for dim, k in dimcats:
817810
logp_curr = self.metropolis_proportional(q, logp, logp_curr, dim, k)
818811

819-
return q, []
812+
# This step doesn't have any tunable parameters
813+
return q, [{"tune": False}]
820814

821815
def astep(self, apoint: RaveledVars, *args) -> tuple[RaveledVars, StatsType]:
822816
raise NotImplementedError()

0 commit comments

Comments
 (0)