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
7020d461
Commit
7020d461
authored
6 years ago
by
Jorn Hoofwijk
Committed by
Bas Nijholt
6 years ago
Browse files
Options
Downloads
Patches
Plain Diff
test the usage of a ConvexHull
parent
1e2713ee
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!127
Resolve "(LearnerND) allow any convex hull as domain"
Pipeline
#13252
passed
6 years ago
Stage: test
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
adaptive/tests/test_learnernd.py
+15
-2
15 additions, 2 deletions
adaptive/tests/test_learnernd.py
with
15 additions
and
2 deletions
adaptive/tests/test_learnernd.py
+
15
−
2
View file @
7020d461
# -*- coding: utf-8 -*-
from
..learner
import
LearnerND
from
..runner
import
replay_log
from
..runner
import
replay_log
,
simple
from
.test_learners
import
ring_of_fire
,
generate_random_parametrization
import
scipy.spatial
def
test_faiure_case_LearnerND
():
log
=
[
...
...
@@ -21,3 +22,15 @@ def test_faiure_case_LearnerND():
]
learner
=
LearnerND
(
lambda
*
x
:
x
,
bounds
=
[(
-
1
,
1
),
(
-
1
,
1
),
(
-
1
,
1
)])
replay_log
(
learner
,
log
)
def
test_interior_vs_bbox_gives_same_result
():
f
=
generate_random_parametrization
(
ring_of_fire
)
control
=
LearnerND
(
f
,
bounds
=
[(
-
1
,
1
),
(
-
1
,
1
)])
hull
=
scipy
.
spatial
.
ConvexHull
(
control
.
_bounds_points
)
learner
=
LearnerND
(
f
,
bounds
=
hull
)
simple
(
control
,
goal
=
lambda
l
:
l
.
loss
()
<
0.1
)
simple
(
learner
,
goal
=
lambda
l
:
l
.
loss
()
<
0.1
)
assert
learner
.
data
==
control
.
data
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