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
2724ceea
Commit
2724ceea
authored
7 years ago
by
Bas Nijholt
Browse files
Options
Downloads
Patches
Plain Diff
2D: remove nstack
parent
4da7a192
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!7
implement 2D learner
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adaptive/learner.py
+3
-12
3 additions, 12 deletions
adaptive/learner.py
with
3 additions
and
12 deletions
adaptive/learner.py
+
3
−
12
View file @
2724ceea
...
...
@@ -741,16 +741,7 @@ class Learner2D(BaseLearner):
dev
=
self
.
_deviation_from_linear_estimate
(
ip
,
grad
)
if
stack_till
is
None
:
# Take new points
try
:
cp
=
0.9
*
dev
.
max
()
nstack
=
min
(
self
.
nstack
,
(
dev
>
cp
).
sum
())
if
nstack
<=
0
:
raise
ValueError
()
except
ValueError
:
nstack
=
1
else
:
nstack
=
stack_till
stack_till
=
1
def
point_exists
(
p
):
eps
=
np
.
finfo
(
float
).
eps
*
self
.
points_combined
.
ptp
()
*
100
...
...
@@ -783,7 +774,7 @@ class Learner2D(BaseLearner):
# Add to stack
self
.
_stack
.
append
(
tuple
(
point_new
))
if
len
(
self
.
_stack
)
>=
n
stack
:
if
len
(
self
.
_stack
)
>=
stack
_till
:
break
else
:
dev
[
jsimplex
]
=
0
...
...
@@ -802,7 +793,7 @@ class Learner2D(BaseLearner):
# it could fill up till a length smaller than `stack_till`.
if
self
.
n
>=
2
**
self
.
ndim
:
# Only fill the stack if no more bounds left in _stack
self
.
_fill_stack
(
stack_till
=
max
(
n_left
,
self
.
nstack
)
)
self
.
_fill_stack
(
stack_till
=
n_left
)
from_stack
=
self
.
_stack
[:
n_left
]
points
+=
from_stack
self
.
add_data
(
from_stack
,
itertools
.
repeat
(
None
))
...
...
This diff is collapsed.
Click to expand it.
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