Skip to content
Snippets Groups Projects
Commit f9032bc4 authored by Jorn Hoofwijk's avatar Jorn Hoofwijk
Browse files

take the correct neigbours into account

parent 6d7da716
No related branches found
No related tags found
No related merge requests found
Pipeline #13099 passed
This commit is part of merge request !131. Comments created here will be created in the context of that merge request.
......@@ -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]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment