...
 
Commits (2)
......@@ -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
......@@ -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
......