adaptive merge requestshttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests2018-09-24T16:59:57Zhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/100Resolve "Learner1D doesn't correctly set the interpolated loss when a point i...2018-09-24T16:59:57ZJorn HoofwijkResolve "Learner1D doesn't correctly set the interpolated loss when a point is added"Closes #99Closes #99Jorn HoofwijkJorn Hoofwijkhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/99Resolve "Learner1D's bound check algo in self.ask doesn't take self.data or s...2018-09-24T16:59:57ZJorn HoofwijkResolve "Learner1D's bound check algo in self.ask doesn't take self.data or self.pending_points"Closes #95
- [x] currently the tests fail, this should be fixed
- [x] add some more tests to check uniformity of the return valueCloses #95
- [x] currently the tests fail, this should be fixed
- [x] add some more tests to check uniformity of the return valueJoseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/98Resolve "DeprecationWarning: sorted_dict.iloc is deprecated. Use SortedDict.k...2018-09-24T16:59:56ZJorn HoofwijkResolve "DeprecationWarning: sorted_dict.iloc is deprecated. Use SortedDict.keys() instead."Closes #92
This might impact performance, since `sorted_dict.keys()` might be O(N), but I am not 100 percent certain on this, but it sounds logicalCloses #92
This might impact performance, since `sorted_dict.keys()` might be O(N), but I am not 100 percent certain on this, but it sounds logicalhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/97Fix #97 and #982018-09-24T16:59:56ZBas NijholtFix #97 and #98See the related issues #97 and #98.See the related issues #97 and #98.Bas NijholtBas Nijholthttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/951D: fix the rare case where the right boundary point exists before the left b...2018-09-24T16:59:56ZBas Nijholt1D: fix the rare case where the right boundary point exists before the left boundFixes #94.Fixes #94.https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/94add runner.max_retries2018-09-24T16:59:56ZBas Nijholtadd runner.max_retriesThis PR (mainly) introduces `runner.max_retries` and `runner.raise_if_max_retries`.
With this the following function would be "learned":
```python
import adaptive
adaptive.notebook_extension()
def f(x, offset=0):
from rando...This PR (mainly) introduces `runner.max_retries` and `runner.raise_if_max_retries`.
With this the following function would be "learned":
```python
import adaptive
adaptive.notebook_extension()
def f(x, offset=0):
from random import random
a = 0.01
if random() < 0.9:
raise Exception('Oops, this failed.')
return x + a**2 / (a**2 + (x - offset)**2)
learner = adaptive.Learner1D(f, bounds=(-1, 1))
runner = adaptive.BlockingRunner(learner, goal=lambda l: l.loss() < 0.05,
max_retries=20, log=True, raise_if_max_retries=False)
```
I also introduce `BlockingRunner.overhead` and the corresponding timing functions and put the shared code of `BlockingRunner` and `AsyncRunner` in `BaseLearner` methods.Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/93add a release guide2018-09-24T16:59:56ZBas Nijholtadd a release guideEven though there are very few steps involved, it is good to have it documented.Even though there are very few steps involved, it is good to have it documented.Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/106add an 'AverageLearner' test that checks the std, mean, and npoints2018-09-24T14:40:27ZBas Nijholtadd an 'AverageLearner' test that checks the std, mean, and npointsJoseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/91(LearnerND) Evaluate less circumspheres2018-08-20T11:57:46ZJorn Hoofwijk(LearnerND) Evaluate less circumspheresit prunes some circumcircles faster
it results in:
~20% faster in 2d
~40% faster in 3d
Helps to speed up LearnerND a bit see (#80)it prunes some circumcircles faster
it results in:
~20% faster in 2d
~40% faster in 3d
Helps to speed up LearnerND a bit see (#80)Jorn HoofwijkJorn Hoofwijkhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/88refactor LearnerND._ask to be more readable (and faster)2018-08-20T11:56:45ZJorn Hoofwijkrefactor LearnerND._ask to be more readable (and faster)Closes #72
Also does help lot to make the learner faster (from O(N) per ask/tell, now only O(log N))
This certainly can be refactored to be even more readable :), I will make sure of it.Closes #72
Also does help lot to make the learner faster (from O(N) per ask/tell, now only O(log N))
This certainly can be refactored to be even more readable :), I will make sure of it.Jorn HoofwijkJorn Hoofwijkhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/86(LearnerND) make default point choosing better2018-07-27T08:38:49ZJorn Hoofwijk(LearnerND) make default point choosing betterCloses #76, #77
This is a first attempt at making the point choosing better, this is done by a modified loss and choose_point_in_simplex method.
The new loss function is the hypervolume of the simplex in the N+M space. eg, if we h...Closes #76, #77
This is a first attempt at making the point choosing better, this is done by a modified loss and choose_point_in_simplex method.
The new loss function is the hypervolume of the simplex in the N+M space. eg, if we have a function $`f: R^2 \to R`$. Then for every evaluated point we have three coordinated (two input, one output). Then we take the surface-area of the triangles, taking into account the output coordinates. This can be done as a triangle in 3d space still has a well-defined area. In essence this is the extension of the loss of the 1D-learner into ND-space.
The choose-point-in-simplex works by taking the center of the simplex, unless the shape of the simplex is sufficiently bad, then it will take the center of the longest edge.
It does this by checking whether the circumcenter lies within the simplex. In 2D this means that the largest angle has to be less than 90 degrees, (in higher dimensions, well something similar I imagine).https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/80add SKOptLearner test2018-07-25T18:32:04ZJoseph Westonadd SKOptLearner testA truly trivial test, but there's not much we can guarantee about
the SKOptLearner.A truly trivial test, but there's not much we can guarantee about
the SKOptLearner.https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/89(triangulation) make method for finding initial simplex part of the triangula...2018-07-25T15:25:35ZJorn Hoofwijk(triangulation) make method for finding initial simplex part of the triangulation classCloses #71
Move some logic from the learner to the triangulation. The signature of the triangulation init changed, it now accepts any number of vertices >= dim+1. instead of only num_vertices == dim+1Closes #71
Move some logic from the learner to the triangulation. The signature of the triangulation init changed, it now accepts any number of vertices >= dim+1. instead of only num_vertices == dim+1https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/79mark failing tests as xfailing2018-07-18T18:42:28ZJoseph Westonmark failing tests as xfailingDoes not fix the errors. Until these are fixed 'IntegratorLearner'
should be considered effectively broken.
See: https://gitlab.kwant-project.org/qt/adaptive/issues/84Does not fix the errors. Until these are fixed 'IntegratorLearner'
should be considered effectively broken.
See: https://gitlab.kwant-project.org/qt/adaptive/issues/84https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/85rename 'learner.tell'2018-07-18T18:40:56ZJoseph Westonrename 'learner.tell'We now define 'tell' and 'tell_many'. Subclasses may implement
either (or both).
Closes #59.We now define 'tell' and 'tell_many'. Subclasses may implement
either (or both).
Closes #59.Bas NijholtBas Nijholthttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/62Plot multi level Learner2D as HoloMap2018-07-18T17:39:39ZBas NijholtPlot multi level Learner2D as HoloMap@AdriaanRol suggested this.
Fixes the issue raised in #56.@AdriaanRol suggested this.
Fixes the issue raised in #56.https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/731D: increase _dx_eps2018-07-16T18:09:20ZBas Nijholt1D: increase _dx_epsThis MR fixes the problem described in https://gitlab.kwant-project.org/qt/adaptive/issues/61.This MR fixes the problem described in https://gitlab.kwant-project.org/qt/adaptive/issues/61.https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/68Add LearnerND that does not interpolate the values of pending points2018-07-16T09:57:29ZJorn HoofwijkAdd LearnerND that does not interpolate the values of pending pointsit has some basic functionality now, there are still some things I am going to fix before we can actually use it:
TODO's:
- [x] add LearnerND
- [x] make a generic loss function that zooms in on deviations
- ~~make a better generic ...it has some basic functionality now, there are still some things I am going to fix before we can actually use it:
TODO's:
- [x] add LearnerND
- [x] make a generic loss function that zooms in on deviations
- ~~make a better generic loss function~~ (separate issue)
- [x] allow asking multiple points in one go
- [x] take pending points into account when choosing a new point
- ~~come up with a better choose_point_in_simplex~~ (separate issue)
- [x] loss_per_simplex should only take a single simplex as input, not the entire triangulation
- ~~make Learner2D a child class of LearnerND (like a special case of the general case)~~
- Performance
- [x] do not recompute triangulation so often
- [x] do not recompute losses for simplices of which you already know the loss
- [x] Triangulation: flip edges when it's beneficial
- [x] add tests for the LearnerND
- [x] add plot_slice functionality for 2D plots as well
- [x] add documentation (both user documentation as well as developer documentation) [currently docstrings and comments]
- ~~add 3d surface plot (separate issue)~~
- ~~add 3d crossection plot~~
- ~~scale Y-values to unit distance as well~~
- [x] allow for N-dimensional output (partially resolved, see #79)
Closes #52 and adds a LearnerNDhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/83Fixup/tests into LearnerND (branch 52)2018-07-12T18:17:07ZJorn HoofwijkFixup/tests into LearnerND (branch 52)Make extra tests for LearnerND and Triangulation class
(I created this merge request so I could open discussions on the tests)Make extra tests for LearnerND and Triangulation class
(I created this merge request so I could open discussions on the tests)https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/82reinitialize learner in runner test2018-07-10T21:51:18ZBas Nijholtreinitialize learner in runner test