Skip to content

Commit effe5c4

Browse files
small changes to speed up find_MAP (#3916)
1 parent ccc78cb commit effe5c4

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

pymc3/tuning/starting.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,11 +140,11 @@ def find_MAP(
140140
def grad_logp(point):
141141
return nan_to_num(-dlogp_func(point))
142142

143-
opt_result = fmin(cost_func, bij.map(start), fprime=grad_logp, *args, **kwargs)
143+
opt_result = fmin(cost_func, x0, fprime=grad_logp, *args, **kwargs)
144144
else:
145145
# Check to see if minimization function uses a starting value
146146
if "x0" in getargspec(fmin).args:
147-
opt_result = fmin(cost_func, bij.map(start), *args, **kwargs)
147+
opt_result = fmin(cost_func, x0, *args, **kwargs)
148148
else:
149149
opt_result = fmin(cost_func, *args, **kwargs)
150150

@@ -174,6 +174,7 @@ def grad_logp(point):
174174
assert isinstance(cost_func.progress, ProgressBar)
175175
cost_func.progress.total = last_v
176176
cost_func.progress.update(last_v)
177+
print()
177178

178179
vars = get_default_varnames(model.unobserved_RVs, include_transformed)
179180
mx = {var.name: value for var, value in zip(vars, model.fastfn(vars)(bij.rmap(mx0)))}

0 commit comments

Comments
 (0)