Skip to content

Commit 0f7e9e4

Browse files
misc
1 parent 2f22c74 commit 0f7e9e4

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

scripts/train.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,15 @@ def evaluate(onlyImproved=False):
9696

9797
dists[i] = min(dist, dists[i]) # track the best distance
9898
# filter the results by the distance, to ignore the outliers
99-
if dists[i] < 0.1:
99+
maxValue = 0.1
100+
if dists[i] < maxValue:
100101
totalLoss.append(loss)
101102
totalDist.append(dist)
103+
else:
104+
# prevent the big "jumps" in the loss and distance when the model is becoming better
105+
# assuming that maxValue is bigger than the corresponding loss
106+
totalLoss.append(maxValue)
107+
totalDist.append(maxValue)
102108
continue
103109
if not onlyImproved:
104110
print('Mean loss: %.5f | Mean distance: %.5f' % (

0 commit comments

Comments
 (0)