Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove EllipticalSlice sampler #5756

Merged
merged 1 commit into from
May 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RELEASE-NOTES.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Instead update the vNext section until 4.0.0 is out.
We plan to get these working again, but at this point their inner workings have not been refactored.
- Timeseries distributions (see [#4642](https://github.com/pymc-devs/pymc/issues/4642))
- Nested Mixture distributions (see [#5533](https://github.com/pymc-devs/pymc/issues/5533))
- Elliptical slice sampling (see [#5137](https://github.com/pymc-devs/pymc/issues/5137))
- `pm.sample_posterior_predictive_w` (see [#4807](https://github.com/pymc-devs/pymc/issues/4807))
- Partially observed Multivariate distributions (see [#5260](https://github.com/pymc-devs/pymc/issues/5260))

Expand All @@ -32,6 +31,7 @@ Signature and default parameters changed for several distributions (see [#5628](
- `pm.AsymmetricLaplace` positional arguments re-ordered
- `pm.AsymmetricLaplace` now requires `mu` to be specified (no longer defaults to 0)
- 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)
- The `pm.EllipticalSlice` sampler was removed (see [#5756](https://github.com/pymc-devs/pymc/issues/5756)).
- `BaseStochasticGradient` was removed (see [#5630](https://github.com/pymc-devs/pymc/pull/5630))
- ⚠ The library is now named, installed and imported as "pymc". For example: `pip install pymc`.
- ⚠ 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)).
Expand Down
1 change: 0 additions & 1 deletion docs/source/api/samplers.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,5 +70,4 @@ Other step methods
:toctree: generated/

CompoundStep
EllipticalSlice
Slice
1 change: 0 additions & 1 deletion pymc/step_methods/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
# limitations under the License.

from pymc.step_methods.compound import CompoundStep
from pymc.step_methods.elliptical_slice import EllipticalSlice
from pymc.step_methods.hmc import NUTS, HamiltonianMC
from pymc.step_methods.metropolis import (
BinaryGibbsMetropolis,
Expand Down
131 changes: 0 additions & 131 deletions pymc/step_methods/elliptical_slice.py

This file was deleted.

26 changes: 0 additions & 26 deletions pymc/tests/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -163,32 +163,6 @@ def mv_simple_discrete():
return model.initial_point(), model, (mu, C)


def mv_prior_simple():
n = 3
noise = 0.1
X = np.linspace(0, 1, n)[:, None]

K = pm.gp.cov.ExpQuad(1, 1)(X).eval()
L = np.linalg.cholesky(K)
K_noise = K + noise * np.eye(n)
obs = floatX_array([-0.1, 0.5, 1.1])

# Posterior mean
L_noise = np.linalg.cholesky(K_noise)
alpha = np.linalg.solve(L_noise.T, np.linalg.solve(L_noise, obs))
mu_post = np.dot(K.T, alpha)

# Posterior standard deviation
v = np.linalg.solve(L_noise, K)
std_post = (K - np.dot(v.T, v)).diagonal() ** 0.5

with pm.Model() as model:
x = pm.Flat("x", size=n)
x_obs = pm.MvNormal("x_obs", observed=obs, mu=x, cov=noise * np.eye(n))

return model.initial_point(), model, (K, L, mu_post, std_post, noise)


def non_normal(n=2):
with pm.Model() as model:
pm.Beta("x", 3, 3, size=n, transform=None)
Expand Down
16 changes: 0 additions & 16 deletions pymc/tests/test_step.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,6 @@
CompoundStep,
DEMetropolis,
DEMetropolisZ,
EllipticalSlice,
HamiltonianMC,
Metropolis,
MultivariateNormalProposal,
Expand All @@ -62,7 +61,6 @@
from pymc.step_methods.mlda import extract_Q_estimate
from pymc.tests.checks import close_to
from pymc.tests.models import (
mv_prior_simple,
mv_simple,
mv_simple_coarse,
mv_simple_discrete,
Expand Down Expand Up @@ -154,19 +152,6 @@ def test_step_categorical(self):
idata = sample(8000, tune=0, step=step, start=start, model=model, random_seed=1)
self.check_stat(check, idata, step.__class__.__name__)

@pytest.mark.xfail(reason="EllipticalSlice not refactored for v4")
def test_step_elliptical_slice(self):
start, model, (K, L, mu, std, noise) = mv_prior_simple()
unc = noise**0.5
check = (("x", np.mean, mu, unc / 10.0), ("x", np.std, std, unc / 10.0))
with model:
steps = (EllipticalSlice(prior_cov=K), EllipticalSlice(prior_chol=L))
for step in steps:
idata = sample(
5000, tune=0, step=step, start=start, model=model, random_seed=1, chains=1
)
self.check_stat(check, idata, step.__class__.__name__)


class TestMetropolisProposal:
def test_proposal_choice(self):
Expand Down Expand Up @@ -1311,7 +1296,6 @@ class TestRVsAssignmentSteps:
(HamiltonianMC, {}),
(Metropolis, {}),
(Slice, {}),
(EllipticalSlice, {"prior_cov": np.eye(1)}),
(DEMetropolis, {}),
(DEMetropolisZ, {}),
# (MLDA, {}), # TODO
Expand Down
1 change: 0 additions & 1 deletion scripts/run_mypy.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
pymc/stats/__init__.py
pymc/step_methods/__init__.py
pymc/step_methods/compound.py
pymc/step_methods/elliptical_slice.py
pymc/step_methods/hmc/__init__.py
pymc/step_methods/hmc/base_hmc.py
pymc/step_methods/hmc/hmc.py
Expand Down