pymc3/step_methods/step_sizes.py
Killed 37 out of 64 mutantsTimeouts
Mutants that made the test suite take a lot longer so the tests were killed.Mutant 32
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -47,7 +47,7 @@
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
- mk = count ** -k
+ mk = count * -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
self._count += 1
Mutant 33
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -47,7 +47,7 @@
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
- mk = count ** -k
+ mk = count ** +k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
self._count += 1
Mutant 37
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -48,7 +48,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
- self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
+ self._log_bar = mk * self._log_step + (2 - mk) * self._log_bar
self._count += 1
def stats(self):
Mutant 38
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -48,7 +48,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
- self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
+ self._log_bar = mk * self._log_step + (1 + mk) * self._log_bar
self._count += 1
def stats(self):
Survived
Survived mutation testing. These mutants show holes in your test suite.Mutant 4
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -23,7 +23,7 @@
self._log_step = np.log(initial_step)
self._log_bar = self._log_step
self._target = target
- self._hbar = 0.
+ self._hbar = 1.0
self._k = k
self._t0 = t0
self._count = 1
Mutant 8
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -26,7 +26,7 @@
self._hbar = 0.
self._k = k
self._t0 = t0
- self._count = 1
+ self._count = 2
self._mu = np.log(10 * initial_step)
self._gamma = gamma
self._tuned_stats = []
Mutant 10
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -27,7 +27,7 @@
self._k = k
self._t0 = t0
self._count = 1
- self._mu = np.log(10 * initial_step)
+ self._mu = np.log(11 * initial_step)
self._gamma = gamma
self._tuned_stats = []
Mutant 11
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -27,7 +27,7 @@
self._k = k
self._t0 = t0
self._count = 1
- self._mu = np.log(10 * initial_step)
+ self._mu = np.log(10 / initial_step)
self._gamma = gamma
self._tuned_stats = []
Mutant 15
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -38,7 +38,7 @@
return np.exp(self._log_bar)
def update(self, accept_stat, tune):
- if not tune:
+ if tune:
self._tuned_stats.append(accept_stat)
return
Mutant 17
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -43,7 +43,7 @@
return
count, k, t0 = self._count, self._k, self._t0
- w = 1. / (count + t0)
+ w = 2.0 / (count + t0)
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
Mutant 29
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -46,7 +46,7 @@
w = 1. / (count + t0)
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
- self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
+ self._log_step = self._mu - self._hbar / np.sqrt(count) / self._gamma
mk = count ** -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
self._count += 1
Mutant 30
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -46,7 +46,7 @@
w = 1. / (count + t0)
self._hbar = ((1 - w) * self._hbar + w * (self._target - accept_stat))
- self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
+ self._log_step = self._mu - self._hbar * np.sqrt(count) * self._gamma
mk = count ** -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
self._count += 1
Mutant 36
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -48,7 +48,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
- self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
+ self._log_bar = mk * self._log_step - (1 - mk) * self._log_bar
self._count += 1
def stats(self):
Mutant 41
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -49,7 +49,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
- self._count += 1
+ self._count = 1
def stats(self):
return {
Mutant 43
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -49,7 +49,7 @@
self._log_step = self._mu - self._hbar * np.sqrt(count) / self._gamma
mk = count ** -k
self._log_bar = mk * self._log_step + (1 - mk) * self._log_bar
- self._count += 1
+ self._count += 2
def stats(self):
return {
Mutant 49
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -63,7 +63,7 @@
target_accept = self._target
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
- n_bound = min(100, len(accept))
+ n_bound = min(101, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
Mutant 51
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -64,7 +64,7 @@
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
- n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
+ n_good, n_bad = mean_accept / n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
Mutant 52
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -64,7 +64,7 @@
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
- n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
+ n_good, n_bad = mean_accept * n_bound, (2 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
Mutant 53
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -64,7 +64,7 @@
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
- n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
+ n_good, n_bad = mean_accept * n_bound, (1 + mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
Mutant 54
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -64,7 +64,7 @@
# Try to find a reasonable interval for acceptable acceptance
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
- n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
+ n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) / n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
Mutant 56
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -65,7 +65,7 @@
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
- lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
+ lower, upper = stats.beta(n_good - 1, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
Mutant 57
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -65,7 +65,7 @@
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
- lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
+ lower, upper = stats.beta(n_good + 2, n_bad + 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
Mutant 58
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -65,7 +65,7 @@
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
- lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
+ lower, upper = stats.beta(n_good + 1, n_bad - 1).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
Mutant 59
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -65,7 +65,7 @@
# probabilities. Finding this was mostry trial and error.
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
- lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
+ lower, upper = stats.beta(n_good + 1, n_bad + 2).interval(0.95)
if target_accept < lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
Mutant 62
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -66,7 +66,7 @@
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
- if target_accept < lower or target_accept > upper:
+ if target_accept <= lower or target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
'number of tuning steps.'
Mutant 63
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -66,7 +66,7 @@
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
- if target_accept < lower or target_accept > upper:
+ if target_accept < lower or target_accept >= upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
'number of tuning steps.'
Mutant 64
--- pymc3/step_methods/step_sizes.py
+++ pymc3/step_methods/step_sizes.py
@@ -66,7 +66,7 @@
n_bound = min(100, len(accept))
n_good, n_bad = mean_accept * n_bound, (1 - mean_accept) * n_bound
lower, upper = stats.beta(n_good + 1, n_bad + 1).interval(0.95)
- if target_accept < lower or target_accept > upper:
+ if target_accept < lower and target_accept > upper:
msg = ('The acceptance probability does not match the target. It '
'is %s, but should be close to %s. Try to increase the '
'number of tuning steps.'