@@ -680,7 +680,6 @@ def competence(var):
680
680
class CategoricalGibbsMetropolisState (StepMethodState ):
681
681
shuffle_dims : bool
682
682
dimcats : list [tuple ]
683
- tune : bool
684
683
685
684
686
685
class CategoricalGibbsMetropolis (ArrayStep ):
@@ -763,10 +762,6 @@ def __init__(
763
762
else :
764
763
raise ValueError ("Argument 'proposal' should either be 'uniform' or 'proportional'" )
765
764
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
-
770
765
if compile_kwargs is None :
771
766
compile_kwargs = {}
772
767
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
796
791
if accepted :
797
792
logp_curr = logp_prop
798
793
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 }]
803
796
804
797
def astep_prop (self , apoint : RaveledVars , * args ) -> tuple [RaveledVars , StatsType ]:
805
798
logp = args [0 ]
@@ -816,7 +809,8 @@ def astep_prop(self, apoint: RaveledVars, *args) -> tuple[RaveledVars, StatsType
816
809
for dim , k in dimcats :
817
810
logp_curr = self .metropolis_proportional (q , logp , logp_curr , dim , k )
818
811
819
- return q , []
812
+ # This step doesn't have any tunable parameters
813
+ return q , [{"tune" : False }]
820
814
821
815
def astep (self , apoint : RaveledVars , * args ) -> tuple [RaveledVars , StatsType ]:
822
816
raise NotImplementedError ()
0 commit comments