Skip to content

Commit 0449072

Browse files
keesterbruggeOriolAbril
authored andcommitted
update function argument
`res = pm.find_MAP(vars=[z], fmin=optimize.fmin_l_bfgs_b)` gave me the error ```python /usr/local/lib/python3.7/dist-packages/fastprogress/fastprogress.py:74: UserWarning: Your generator is empty. warn("Your generator is empty.") --------------------------------------------------------------------------- TypeError Traceback (most recent call last) <ipython-input-19-1697d3cf79ec> in <module>() 1 smoothing = 0.5 ----> 2 z_val = infer_z(smoothing) 3 4 plot(x, y) 5 plot(x, z_val) 1 frames /usr/local/lib/python3.7/dist-packages/pymc3/tuning/starting.py in find_MAP(start, vars, method, return_raw, include_transformed, progressbar, maxeval, model, *args, **kwargs) 133 134 try: --> 135 opt_result = minimize(cost_func, x0, method=method, jac=compute_gradient, *args, **kwargs) 136 mx0 = opt_result["x"] # r -> opt_result 137 except (KeyboardInterrupt, StopIteration) as e: TypeError: minimize() got an unexpected keyword argument 'fmin' ``` whereas `res = pm.find_MAP(vars=[z], method="L-BFGS-B")` did work for me
1 parent 5c21572 commit 0449072

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

examples/gaussian_processes/GP-smoothing.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,7 @@
207207
"def infer_z(smoothing):\n",
208208
" with model:\n",
209209
" smoothing_param.set_value(smoothing)\n",
210-
" res = pm.find_MAP(vars=[z], fmin=optimize.fmin_l_bfgs_b)\n",
210+
" res = pm.find_MAP(vars=[z], method=\"L-BFGS-B\")\n",
211211
" return res[\"z\"]"
212212
]
213213
},

0 commit comments

Comments
 (0)