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
Commits
940342e7
Commit
940342e7
authored
7 years ago
by
Bas Nijholt
Browse files
Options
Downloads
Patches
Plain Diff
make returning of the bounds more robust against adding points after data is already added
parent
fdf3cec7
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adaptive/learner.py
+6
-8
6 additions, 8 deletions
adaptive/learner.py
with
6 additions
and
8 deletions
adaptive/learner.py
+
6
−
8
View file @
940342e7
...
...
@@ -219,14 +219,12 @@ class Learner1D(BaseLearner):
# Return equally spaced points within each interval to which points
# will be added.
if
len
(
self
.
data
)
==
0
:
if
n
==
1
:
return
[
self
.
bounds
[
0
]]
else
:
return
self
.
bounds
elif
len
(
self
.
data
)
==
1
:
return
[
self
.
bounds
[
1
]]
for
bound
in
self
.
bounds
:
if
bound
not
in
self
.
data
:
if
n
==
1
:
return
[
bound
]
else
:
return
self
.
bounds
def
points
(
x
,
n
):
return
list
(
np
.
linspace
(
x
[
0
],
x
[
1
],
n
,
endpoint
=
False
)[
1
:])
...
...
This diff is collapsed.
Click to expand it.
Bas Nijholt
@basnijholt
mentioned in issue
#13 (closed)
·
7 years ago
mentioned in issue
#13 (closed)
mentioned in issue #13
Toggle commit list
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment