Browse code

1D: fix bug in _default_loss_per_interval

Bas Nijholt authored on 22/11/2017 11:46:06
Showing 1 changed files
... ...
@@ -27,7 +27,7 @@ def _default_loss_per_interval(interval, scale, function_values):
27 27
         loss = dx
28 28
     else:
29 29
         dy = (y_right - y_left) / y_scale
30
-        if hasattr(dy, '__len__') and len(y) > 1:
30
+        if hasattr(dy, '__len__') and len(dy) > 1:
31 31
             loss = np.hypot(dx, dy).max()
32 32
         else:
33 33
             loss = math.hypot(dx, dy)