Browse code

2D: clearer definition of the loss

Bas Nijholt authored on 25/10/2017 10:24:30
Showing 1 changed files
... ...
@@ -666,10 +666,8 @@ class Learner2D(BaseLearner):
666 666
         dev = _deviation_from_linear_estimate(ip)
667 667
         ps = ip.tri.points[ip.tri.vertices]
668 668
         vs = ip.values[ip.tri.vertices]
669
-        triangle_size = np.sqrt(triangle_area(ps))
670
-        dev = dev / vs.ptp()
671
-        losses = np.hypot(
672
-            dev, 0.5 * triangle_size / triangle_size.max() * dev.max())
669
+        triangle_size = triangle_area(ps) / 4  # /4 because the area=4
670
+        losses = np.hypot(dev / vs.ptp(), triangle_size)
673 671
         return losses
674 672
 
675 673
     def _fill_stack(self, stack_till=None):