Skip to content

Commit

Permalink
Merge 598ec0c into 08a7683
Browse files Browse the repository at this point in the history
  • Loading branch information
szapp committed Jun 27, 2018
2 parents 08a7683 + 598ec0c commit c241319
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion proxalgs/core.py
Expand Up @@ -75,7 +75,10 @@ def add_regularizer(self, proxfun, **kwargs):
# if proxfun is a string, grab the corresponding function from operators.py
if isinstance(proxfun, str):
try:
self.objectives.append(lambda theta, rho: getattr(operators, proxfun)(theta.copy(), float(rho), **kwargs))
proxfun_name = proxfun.split(None, 1)[0]
# Ignore everything after white space
op = getattr(operators, proxfun_name)
self.objectives.append(lambda theta, rho: op(theta.copy(), float(rho), **kwargs))

except AttributeError as e:
print(str(e) + '\n' + 'Could not find the function ' + proxfun + ' in the operators module!')
Expand Down

0 comments on commit c241319

Please sign in to comment.