Skip to content

Commit

Permalink
minor 🐛fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Niru Maheswaranathan committed Jun 30, 2017
1 parent c09f1b4 commit 074c845
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions descent/objectives.py
Expand Up @@ -40,14 +40,14 @@ def param_init():
return decorator


@objective(xstar=(0,), param_scales=(10,))
@objective(xstar=0, param_scales=(10,))
def doublewell(theta):
"""Pointwise minimum of two quadratic bowls"""
k0, k1, depth = 0.01, 100, 0.5
shallow = 0.5 * k0 * theta ** 2 + depth
deep = 0.5 * k1 * theta ** 2
obj = np.minimum(shallow, deep)
grad = np.where(deep < shallow, k0 * theta, k1 * theta)
obj = float(np.minimum(shallow, deep))
grad = np.where(deep < shallow, k1 * theta, k0 * theta)
return obj, grad


Expand Down

0 comments on commit 074c845

Please sign in to comment.