Skip to content

Commit ab593b1

Browse files
michaelosthegericardoV94
authored andcommitted
Remove EllipticalSlice sampler
Closes #5137
1 parent ce2e891 commit ab593b1

File tree

7 files changed

+1
-177
lines changed

7 files changed

+1
-177
lines changed

RELEASE-NOTES.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@ Instead update the vNext section until 4.0.0 is out.
1414
We plan to get these working again, but at this point their inner workings have not been refactored.
1515
- Timeseries distributions (see [#4642](https://github.com/pymc-devs/pymc/issues/4642))
1616
- Nested Mixture distributions (see [#5533](https://github.com/pymc-devs/pymc/issues/5533))
17-
- Elliptical slice sampling (see [#5137](https://github.com/pymc-devs/pymc/issues/5137))
1817
- `pm.sample_posterior_predictive_w` (see [#4807](https://github.com/pymc-devs/pymc/issues/4807))
1918
- Partially observed Multivariate distributions (see [#5260](https://github.com/pymc-devs/pymc/issues/5260))
2019

@@ -32,6 +31,7 @@ Signature and default parameters changed for several distributions (see [#5628](
3231
- `pm.AsymmetricLaplace` positional arguments re-ordered
3332
- `pm.AsymmetricLaplace` now requires `mu` to be specified (no longer defaults to 0)
3433
- BART was removed [#5566](https://github.com/pymc-devs/pymc/pull/5566). It is now available from [pymc-experimental](https://github.com/pymc-devs/pymc-experimental)
34+
- The `pm.EllipticalSlice` sampler was removed (see [#5756](https://github.com/pymc-devs/pymc/issues/5756)).
3535
- `BaseStochasticGradient` was removed (see [#5630](https://github.com/pymc-devs/pymc/pull/5630))
3636
- ⚠ The library is now named, installed and imported as "pymc". For example: `pip install pymc`.
3737
- ⚠ Theano-PyMC has been replaced with Aesara, so all external references to `theano`, `tt`, and `pymc3.theanof` need to be replaced with `aesara`, `at`, and `pymc.aesaraf` (see [4471](https://github.com/pymc-devs/pymc/pull/4471)).

docs/source/api/samplers.rst

-1
Original file line numberDiff line numberDiff line change
@@ -70,5 +70,4 @@ Other step methods
7070
:toctree: generated/
7171

7272
CompoundStep
73-
EllipticalSlice
7473
Slice

pymc/step_methods/__init__.py

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
# limitations under the License.
1414

1515
from pymc.step_methods.compound import CompoundStep
16-
from pymc.step_methods.elliptical_slice import EllipticalSlice
1716
from pymc.step_methods.hmc import NUTS, HamiltonianMC
1817
from pymc.step_methods.metropolis import (
1918
BinaryGibbsMetropolis,

pymc/step_methods/elliptical_slice.py

-131
This file was deleted.

pymc/tests/models.py

-26
Original file line numberDiff line numberDiff line change
@@ -163,32 +163,6 @@ def mv_simple_discrete():
163163
return model.initial_point(), model, (mu, C)
164164

165165

166-
def mv_prior_simple():
167-
n = 3
168-
noise = 0.1
169-
X = np.linspace(0, 1, n)[:, None]
170-
171-
K = pm.gp.cov.ExpQuad(1, 1)(X).eval()
172-
L = np.linalg.cholesky(K)
173-
K_noise = K + noise * np.eye(n)
174-
obs = floatX_array([-0.1, 0.5, 1.1])
175-
176-
# Posterior mean
177-
L_noise = np.linalg.cholesky(K_noise)
178-
alpha = np.linalg.solve(L_noise.T, np.linalg.solve(L_noise, obs))
179-
mu_post = np.dot(K.T, alpha)
180-
181-
# Posterior standard deviation
182-
v = np.linalg.solve(L_noise, K)
183-
std_post = (K - np.dot(v.T, v)).diagonal() ** 0.5
184-
185-
with pm.Model() as model:
186-
x = pm.Flat("x", size=n)
187-
x_obs = pm.MvNormal("x_obs", observed=obs, mu=x, cov=noise * np.eye(n))
188-
189-
return model.initial_point(), model, (K, L, mu_post, std_post, noise)
190-
191-
192166
def non_normal(n=2):
193167
with pm.Model() as model:
194168
pm.Beta("x", 3, 3, size=n, transform=None)

pymc/tests/test_step.py

-16
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@
5050
CompoundStep,
5151
DEMetropolis,
5252
DEMetropolisZ,
53-
EllipticalSlice,
5453
HamiltonianMC,
5554
Metropolis,
5655
MultivariateNormalProposal,
@@ -62,7 +61,6 @@
6261
from pymc.step_methods.mlda import extract_Q_estimate
6362
from pymc.tests.checks import close_to
6463
from pymc.tests.models import (
65-
mv_prior_simple,
6664
mv_simple,
6765
mv_simple_coarse,
6866
mv_simple_discrete,
@@ -154,19 +152,6 @@ def test_step_categorical(self):
154152
idata = sample(8000, tune=0, step=step, start=start, model=model, random_seed=1)
155153
self.check_stat(check, idata, step.__class__.__name__)
156154

157-
@pytest.mark.xfail(reason="EllipticalSlice not refactored for v4")
158-
def test_step_elliptical_slice(self):
159-
start, model, (K, L, mu, std, noise) = mv_prior_simple()
160-
unc = noise**0.5
161-
check = (("x", np.mean, mu, unc / 10.0), ("x", np.std, std, unc / 10.0))
162-
with model:
163-
steps = (EllipticalSlice(prior_cov=K), EllipticalSlice(prior_chol=L))
164-
for step in steps:
165-
idata = sample(
166-
5000, tune=0, step=step, start=start, model=model, random_seed=1, chains=1
167-
)
168-
self.check_stat(check, idata, step.__class__.__name__)
169-
170155

171156
class TestMetropolisProposal:
172157
def test_proposal_choice(self):
@@ -1311,7 +1296,6 @@ class TestRVsAssignmentSteps:
13111296
(HamiltonianMC, {}),
13121297
(Metropolis, {}),
13131298
(Slice, {}),
1314-
(EllipticalSlice, {"prior_cov": np.eye(1)}),
13151299
(DEMetropolis, {}),
13161300
(DEMetropolisZ, {}),
13171301
# (MLDA, {}), # TODO

scripts/run_mypy.py

-1
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,6 @@
5656
pymc/stats/__init__.py
5757
pymc/step_methods/__init__.py
5858
pymc/step_methods/compound.py
59-
pymc/step_methods/elliptical_slice.py
6059
pymc/step_methods/hmc/__init__.py
6160
pymc/step_methods/hmc/base_hmc.py
6261
pymc/step_methods/hmc/hmc.py

0 commit comments

Comments
 (0)