Skip to content

Commit a61cf73

Browse files
committed
Removed Constant step method
1 parent af2dcb2 commit a61cf73

File tree

2 files changed

+2
-31
lines changed

2 files changed

+2
-31
lines changed

pymc3/step_methods/__init__.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,4 @@
1616

1717
from .slicer import Slice
1818

19-
from .nuts import NUTS
20-
21-
from .arraystep import Constant
19+
from .nuts import NUTS

pymc3/step_methods/arraystep.py

Lines changed: 1 addition & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from enum import IntEnum, unique
99

1010
__all__ = ['ArrayStep', 'ArrayStepShared', 'metrop_select', 'SamplerHist',
11-
'Competence', 'Constant']
11+
'Competence']
1212

1313

1414
@unique
@@ -163,30 +163,3 @@ def __init__(self):
163163
def acceptr(self):
164164
return np.minimum(np.exp(self.metrops), 1)
165165

166-
167-
class Constant(ArrayStep):
168-
"""
169-
Dummy sampler that returns the current value at every iteration. Useful for
170-
fixing parameters at a particular value.
171-
172-
Parameters
173-
----------
174-
vars : list
175-
List of variables for sampler.
176-
model : PyMC Model
177-
Optional model for sampling step. Defaults to None (taken from context).
178-
"""
179-
180-
def __init__(self, vars, model=None, **kwargs):
181-
182-
model = modelcontext(model)
183-
184-
self.model = model
185-
186-
vars = inputvars(vars)
187-
188-
super(Constant, self).__init__(vars, [model.fastlogp], **kwargs)
189-
190-
def astep(self, q0, logp):
191-
192-
return q0

0 commit comments

Comments
 (0)