Resolve "(LearnerND) allow any convex hull as domain"
Closes #114 (closed)
Works especially well when combined with !124 (merged)
usage:
import scipy
import adaptive
adaptive.notebook_extension()
def f(xyz):
x, y, z = xyz
return x**4 + y**4 + z**4 - (x**2+y**2+z**2)**2
b = [(-1, -1, -1),
(-1, 1, -1),
(-1, -1, 1),
(-1, 1, 1),
( 1, 1, -1),
( 1, -1, -1)]
bounds = scipy.spatial.ConvexHull(b)
learner = adaptive.LearnerND(f, bounds)
runner = adaptive.Runner(learner, goal=lambda l:l.npoints>1000)
runner.live_info()
Now, if you indeed also have !124 (merged) at your disposal, you are able to run something like this:
learner.plot_isosurface(-0.5)
in order to get this:
otherwise you could run:
learner.plot_slice({1:0})
to get this:
Edited by Jorn Hoofwijk
Merge request reports
Activity
added 4 commits
-
18106f5f...3a69cd99 - 2 commits from branch
master
- 435405d1 - allow passing a convex hull to LearnerND
- b513dc3a - correctly set bounds
-
18106f5f...3a69cd99 - 2 commits from branch
added 23 commits
-
b513dc3a...ad7a3d23 - 22 commits from branch
master
- 9d368d64 - allow passing a convex hull to LearnerND
-
b513dc3a...ad7a3d23 - 22 commits from branch
mentioned in issue #117
- Resolved by Bas Nijholt
added 1 commit
- f1ef8309 - only do expensive inside_bounds check when the hull is not rectangular
added 8 commits
-
f1ef8309...6cdd24e9 - 6 commits from branch
master
- 50890a99 - allow passing a convex hull to LearnerND
- c16c89ef - only do expensive inside_bounds check when the hull is not rectangular
-
f1ef8309...6cdd24e9 - 6 commits from branch
added 1 commit
- c0472fab - only do expensive inside_bounds check when the hull is not rectangular
added 4 commits
-
c0472fab...7f936b7c - 2 commits from branch
master
- cb5facdd - allow passing a convex hull to LearnerND
- 02e66a0b - only do expensive inside_bounds check when the hull is not rectangular
-
c0472fab...7f936b7c - 2 commits from branch
- Resolved by Jorn Hoofwijk
We can add a test for adding rectangular bounds as a hull and checking that we get the same result as passing the bounds "as usual".
- Resolved by Joseph Weston
- Resolved by Jorn Hoofwijk
We should also add an example to the LearnerND documentation!
mentioned in merge request !124 (merged)
added 19 commits
-
8a48725c...1ffe2209 - 15 commits from branch
master
- 939074cc - allow passing a convex hull to LearnerND
- 70ef26e0 - only do expensive inside_bounds check when the hull is not rectangular
- 790a2737 - added test
- e1c43304 - make test pass by sorting the bound points and adding an eps to the
Toggle commit list-
8a48725c...1ffe2209 - 15 commits from branch
added 2 commits
Please register or sign in to reply