Skip to content
Snippets Groups Projects

Resolve "(LearnerND) allow any convex hull as domain"

Merged Jorn Hoofwijk requested to merge 114--learnerND-convex-hull into master

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:

image

otherwise you could run:

learner.plot_slice({1:0})

to get this:

image

Edited by Jorn Hoofwijk

Merge request reports

Pipeline #13252 passed

Pipeline passed for 7020d461 on 114--learnerND-convex-hull

Test coverage 79.00% (0.00%) from 1 job

Merged by Joseph WestonJoseph Weston 6 years ago (Nov 14, 2018 2:20pm UTC)

Loading

Pipeline #13349 passed

Pipeline passed for ccba17dd on master

Test coverage 79.00% (0.00%) from 1 job

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Bas Nijholt resolved all discussions

    resolved all discussions

  • Bas Nijholt added 1 commit

    added 1 commit

    • f1ef8309 - only do expensive inside_bounds check when the hull is not rectangular

    Compare with previous version

  • Bas Nijholt added 8 commits

    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

    Compare with previous version

  • Bas Nijholt added 1 commit

    added 1 commit

    • c0472fab - only do expensive inside_bounds check when the hull is not rectangular

    Compare with previous version

  • Bas Nijholt added 4 commits

    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

    Compare with previous version

  • Bas Nijholt mentioned in merge request !124 (merged)

    mentioned in merge request !124 (merged)

  • Jorn Hoofwijk added 2 commits

    added 2 commits

    • c59041a1 - added test
    • 8a48725c - make test pass by sorting the bound points and adding an eps to the

    Compare with previous version

  • Jorn Hoofwijk added 19 commits

    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

    Compare with previous version

  • Jorn Hoofwijk added 2 commits

    added 2 commits

    Compare with previous version

  • Bas Nijholt added 1 commit

    added 1 commit

    • 3c777158 - Update tutorial.LearnerND.rst

    Compare with previous version

  • Jorn Hoofwijk resolved all discussions

    resolved all discussions

  • Jorn Hoofwijk resolved all discussions

    resolved all discussions

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading