Skip to content

Commit 1e845bf

Browse files
committed
Generalize find_MAP to accept more scipy.optimize functions
1 parent 968f341 commit 1e845bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

pymc3/tuning/starting.py

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,11 @@ def grad_logp_o(point):
8383
r = fmin(logp_o, bij.map(
8484
start), fprime=grad_logp_o, *args, **kwargs)
8585
else:
86-
r = fmin(logp_o, bij.map(start), *args, **kwargs)
86+
# Check to see if minimization function uses a starting value
87+
if 'x0' in getargspec(fmin).args:
88+
r = fmin(logp_o, bij.map(start), *args, **kwargs)
89+
else:
90+
r = fmin(logp_o, *args, **kwargs)
8791

8892
if isinstance(r, tuple):
8993
mx0 = r[0]

0 commit comments

Comments
 (0)