Skip to content

Commit

Permalink
Bugfix: Do not pass argument f_grad to gradient-free optimization alg…
Browse files Browse the repository at this point in the history
…orithms
  • Loading branch information
andreArtelt committed Sep 4, 2019
1 parent 399ccaf commit 45f8416
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ceml/optim/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ def prepare_optim(optim, f, x0, f_grad=None, tol=None, max_iter=None):
else:
raise ValueError(f"Invalid value of 'optim'.\n'optim' has to be 'nelder-mead', 'powell', 'cg' or 'bfgs' but not '{optim}'")
elif isinstance(optim, Optimizer):
args = {'f': f, 'x0': x0, 'f_grad': f_grad, 'tol': tol, 'max_iter': max_iter}
args = {'f': f, 'x0': x0, 'tol': tol, 'max_iter': max_iter}
if is_optimizer_grad_based(optim):
args['f_grad'] = f_grad

Expand Down

0 comments on commit 45f8416

Please sign in to comment.