...
 
Commits (5)
......@@ -3,6 +3,15 @@
## PyMC3 3.9.x (on deck)
*waiting for contributions*
## PyMC3 3.9.2 (24 June 2020)
### Maintenance
- Warning added in GP module when `input_dim` is lower than the number of columns in `X` to compute the covariance function (see [#3974](https://github.com/pymc-devs/pymc3/pull/3974)).
- Pass the `tune` argument from `sample` when using `advi+adapt_diag_grad` (see issue [#3965](https://github.com/pymc-devs/pymc3/issues/3965), fixed by [#3979](https://github.com/pymc-devs/pymc3/pull/3979)).
- Add simple test case for new coords and dims feature in `pm.Model` (see [#3977](https://github.com/pymc-devs/pymc3/pull/3977)).
- Require ArviZ >= 0.9.0 (see [#3977](https://github.com/pymc-devs/pymc3/pull/3977)).
_NB: The `docs/*` folder is still removed from the tarball due to an upload size limit on PyPi._
## PyMC3 3.9.1 (16 June 2020)
The `v3.9.0` upload to PyPI didn't include a tarball, which is fixed in this release.
Though we had to temporarily remove the `docs/*` folder from the tarball due to a size limit.
......
......@@ -13,7 +13,7 @@
# limitations under the License.
# pylint: disable=wildcard-import
__version__ = "3.9.1"
__version__ = "3.9.2"
import logging
import multiprocessing as mp
......
......@@ -307,7 +307,7 @@ class QuadPotentialDiagAdaptGrad(QuadPotentialDiagAdapt):
self._ngrads2 += 1
if self._n_samples <= 150:
super().update(sample, grad)
super().update(sample, grad, tune)
else:
self._update((self._ngrads1 / self._grads1) ** 2)
......
import pymc3 as pm
import numpy as np
def test_coords():
chains = 2
n_features = 3
n_samples = 10
coords = {"features": np.arange(n_features)}
with pm.Model(coords=coords):
a = pm.Uniform("a", -100, 100, dims="features")
b = pm.Uniform("b", -100, 100, dims="features")
tr = pm.sample(n_samples, chains=chains, return_inferencedata=True)
assert "features" in tr.posterior.a.coords.dims
assert "features" in tr.posterior.b.coords.dims
......@@ -23,6 +23,7 @@ import pymc3 as pm
from pymc3.distributions import HalfCauchy, Normal, transforms
from pymc3 import Potential, Deterministic
from pymc3.model import ValueGradFunction
from .helpers import select_by_precision
class NewModel(pm.Model):
......@@ -192,17 +193,33 @@ def test_matrix_multiplication():
tune=0,
compute_convergence_checks=False,
progressbar=False)
decimal = select_by_precision(7, 5)
for point in posterior.points():
npt.assert_almost_equal(point['matrix'] @ point['transformed'],
point['rv_rv'])
npt.assert_almost_equal(np.ones((2, 2)) @ point['transformed'],
point['np_rv'])
npt.assert_almost_equal(point['matrix'] @ np.ones(2),
point['rv_np'])
npt.assert_almost_equal(point['matrix'] @ point['rv_rv'],
point['rv_det'])
npt.assert_almost_equal(point['rv_rv'] @ point['transformed'],
point['det_rv'])
npt.assert_almost_equal(
point['matrix'] @ point['transformed'],
point['rv_rv'],
decimal=decimal,
)
npt.assert_almost_equal(
np.ones((2, 2)) @ point['transformed'],
point['np_rv'],
decimal=decimal,
)
npt.assert_almost_equal(
point['matrix'] @ np.ones(2),
point['rv_np'],
decimal=decimal,
)
npt.assert_almost_equal(
point['matrix'] @ point['rv_rv'],
point['rv_det'],
decimal=decimal,
)
npt.assert_almost_equal(
point['rv_rv'] @ point['transformed'],
point['det_rv'],
decimal=decimal,
)
def test_duplicate_vars():
......
......@@ -283,3 +283,9 @@ def test_full_adapt_sampling(seed=289586):
pymc3.sample(
draws=10, tune=1000, random_seed=seed, step=step, cores=1, chains=1
)
def test_issue_3965():
with pymc3.Model():
pymc3.Normal('n')
pymc3.sample(100, tune=300, chains=1, init='advi+adapt_diag_grad')
arviz>=0.8.3
arviz>=0.9.0
theano>=1.0.4
numpy>=1.13.0
scipy>=0.18.1
......