Skip to content
Snippets Groups Projects

Resolve "(Learner1D) add possibility to use the direct neighbors in the loss"

Merged Jorn Hoofwijk requested to merge 119-add-second-order-loss-to-adaptive into master
Compare and Show latest version
1 file
+ 3
2
Compare changes
  • Side-by-side
  • Inline
@@ -74,9 +74,10 @@ def triangle_loss(interval, scale, data, neighbors):
x_left, x_right = interval
xs = [x_left, x_right]
if x_left in neighbors:
xs.insert(0, neighbors[x_left][1])
xs.insert(0, neighbors[x_left][0])
if x_right in neighbors:
xs.append(neighbors[x_right][0])
xs.append(neighbors[x_right][1])
xs = [x for x in xs if x is not None]
if len(xs) <= 2:
return (x_right - x_left) / scale[0]
Loading