Skip to content
Snippets Groups Projects
Commit 9937acfd authored by Bas Nijholt's avatar Bas Nijholt
Browse files

1D: fix the rare case where the right boundary point exists before the left bound

parent 6a1ec632
No related branches found
No related tags found
1 merge request!951D: fix the rare case where the right boundary point exists before the left bound
Pipeline #11913 passed
......@@ -269,9 +269,14 @@ class Learner1D(BaseLearner):
loss_improvements = [np.inf] * n
points = np.linspace(*self.bounds, n).tolist()
elif len(points) == 1:
# Second time, if we previously returned just self.bounds[0]
loss_improvements = [np.inf] * n
points = np.linspace(*self.bounds, n + 1)[1:].tolist()
_points = np.linspace(*self.bounds, n + 1).tolist()
if points[0] == self.bounds[1]:
# Second time, if we previously returned just self.bounds[0]
points = _points[1:]
else:
# Rare case in which self.bounds[1] is present before self.bounds[1]
points = _points[:1]
else:
def xs(x_left, x_right, n):
if n == 1:
......
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