Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
adaptive
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
This is an archived project. Repository and other project resources are read-only.
Show more breadcrumbs
Quantum Tinkerer
adaptive
Merge requests
!95
1D: fix the rare case where the right boundary point exists before the left bound
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
1D: fix the rare case where the right boundary point exists before the left bound
learner1D_bounds_bug
into
master
Overview
1
Commits
5
Pipelines
5
Changes
1
Merged
Bas Nijholt
requested to merge
learner1D_bounds_bug
into
master
6 years ago
Overview
1
Commits
5
Pipelines
5
Changes
1
Expand
Fixes
#94 (closed)
.
1
0
Merge request reports
Viewing commit
67fbc02e
Show latest version
1 file
+
9
−
8
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
67fbc02e
rename 'points' -> 'missing_bounds'
· 67fbc02e
Bas Nijholt
authored
6 years ago
adaptive/learner/learner1D.py
+
9
−
8
Options
@@ -261,22 +261,22 @@ class Learner1D(BaseLearner):
return
[],
[]
# If the bounds have not been chosen yet, we choose them first.
point
s
=
[
b
for
b
in
self
.
bounds
if
b
not
in
self
.
data
and
b
not
in
self
.
pending_points
]
missing_bound
s
=
[
b
for
b
in
self
.
bounds
if
b
not
in
self
.
data
and
b
not
in
self
.
pending_points
]
if
len
(
point
s
)
==
2
:
if
len
(
missing_bound
s
)
==
2
:
# First time
loss_improvements
=
[
np
.
inf
]
*
n
points
=
np
.
linspace
(
*
self
.
bounds
,
n
).
tolist
()
elif
len
(
point
s
)
==
1
:
elif
len
(
missing_bound
s
)
==
1
:
loss_improvements
=
[
np
.
inf
]
*
n
_
points
=
np
.
linspace
(
*
self
.
bounds
,
n
+
1
).
tolist
()
if
point
s
[
0
]
==
self
.
bounds
[
1
]:
points
=
np
.
linspace
(
*
self
.
bounds
,
n
+
1
).
tolist
()
if
missing_bound
s
[
0
]
==
self
.
bounds
[
1
]:
# Second time, if we previously returned just self.bounds[0]
points
=
_
points
[
1
:]
points
=
points
[
1
:]
else
:
# Rare case in which self.bounds[1] is present before self.bounds[1]
points
=
_
points
[:
1
]
points
=
points
[:
1
]
else
:
def
xs
(
x_left
,
x_right
,
n
):
if
n
==
1
:
@@ -311,6 +311,7 @@ class Learner1D(BaseLearner):
return
points
,
loss_improvements
def
plot
(
self
):
hv
=
ensure_holoviews
()
if
not
self
.
data
:
Loading