adaptive merge requestshttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests2018-09-24T16:59:57Zhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/101Resolve "Learner1D fails when function returns a list instead of a numpy.array"2018-09-24T16:59:57ZJorn HoofwijkResolve "Learner1D fails when function returns a list instead of a numpy.array"Closes #96Closes #96Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/102introduce 'runner.retries' and 'runner.raise_if_retries_exceeded'2018-09-24T16:59:57ZBas Nijholtintroduce 'runner.retries' and 'runner.raise_if_retries_exceeded'Continuing !94.Continuing !94.https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/1032D: rename 'learner._interp' to 'learner.pending_points' as in other learners2018-09-24T16:59:57ZBas Nijholt2D: rename 'learner._interp' to 'learner.pending_points' as in other learnersThis is what it's called in the `Learner1D`, `AverageLearner` (!104), and `Runner`.This is what it's called in the `Learner1D`, `AverageLearner` (!104), and `Runner`.Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/104Make the AverageLearner only return new points ...2018-09-24T16:59:57ZBas NijholtMake the AverageLearner only return new points ...and introduce `learner.pending_points` to make it more similar to the rest of Adaptive.
I've added a test that will fail with the current master.and introduce `learner.pending_points` to make it more similar to the rest of Adaptive.
I've added a test that will fail with the current master.Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/105move specific tests for a particular learner to separate files2018-09-24T16:59:57ZBas Nijholtmove specific tests for a particular learner to separate filesand rename `test_learner.py` -> `test_learners.py`.
We leave tests that are general (apply to multiple learners) in `test_learners.py`.and rename `test_learner.py` -> `test_learners.py`.
We leave tests that are general (apply to multiple learners) in `test_learners.py`.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/107Introduce 'tell_pending' which replaces 'tell(x, None)'2018-09-24T16:59:57ZBas NijholtIntroduce 'tell_pending' which replaces 'tell(x, None)'and I also tackle
* `lower_bound <= learner.ask()[0] <= upper_bound`
* if we `tell(x, y)` with `x` outside the bounds, the point should be added to `data`, but not any of the other internal datastructures. This will mean that the poin...and I also tackle
* `lower_bound <= learner.ask()[0] <= upper_bound`
* if we `tell(x, y)` with `x` outside the bounds, the point should be added to `data`, but not any of the other internal datastructures. This will mean that the point will be "invisible" to the learning algorithm, and only useful for plotting and data extraction
for **both** the `Learner1D` and `Learner2D` in that MR. I included this in here to avoid merge conflicts later.Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/108exponentially decay message frequency in live_info2018-11-30T11:08:06ZJorn Hoofwijkexponentially decay message frequency in live_infoThis way, you would not have to wait for all messages to be displayed after you open your laptop in the morning when you run an simulation overnight on the cluster.
notice this is a proof of concept, the randomness is not really impor...This way, you would not have to wait for all messages to be displayed after you open your laptop in the morning when you run an simulation overnight on the cluster.
notice this is a proof of concept, the randomness is not really important, but could be removed with if we keep track of the last printed message. Also it depends on `status.comm.kernel.iopub_thread._events` which I suppose is meant for internal usage (indicated by the underscore before `_events`.
Both these should be possible to mitigate when more time is spend on those parts.Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/109make a BalancingLearner strategy that compares the total loss rather than los...2018-11-30T11:08:06ZJorn Hoofwijkmake a BalancingLearner strategy that compares the total loss rather than loss improvementCloses #103Closes #103Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/110WIP: move the function to the runner2018-10-01T11:36:47ZBas NijholtWIP: move the function to the runnerThis is a quick implementation of putting the function inside the `Runner` and now only works with the `Learner1D` and the `BalancingLearner`.
I don't plan on merging this but it's for #46.
This is a quick implementation of putting the function inside the `Runner` and now only works with the `Learner1D` and the `BalancingLearner`.
I don't plan on merging this but it's for #46.
https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/111Resolve "Make BaseRunner an abstract base class"2018-11-30T11:08:06ZJorn HoofwijkResolve "Make BaseRunner an abstract base class"Closes #107Closes #107Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/112Resolve "LearnerND fails for BalancingLearner test"2018-09-25T11:02:19ZJorn HoofwijkResolve "LearnerND fails for BalancingLearner test"Closes #105Closes #105https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/113Resolve "(BalancingLearner) loss is cached incorrectly"2018-10-01T11:32:07ZJorn HoofwijkResolve "(BalancingLearner) loss is cached incorrectly"Closes #108Closes #108v0.6https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/114update release guide to add a 'dev' tag on top of regular tags2018-09-26T12:32:45ZJoseph Westonupdate release guide to add a 'dev' tag on top of regular tagsv0.6Bas NijholtBas Nijholthttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/115Resolve "How should learners handle data that is outside of the domain"2018-09-26T12:33:49ZJorn HoofwijkResolve "How should learners handle data that is outside of the domain"Closes #101Closes #101v0.6Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/1162D: fix #1092018-10-04T13:32:27ZBas Nijholt2D: fix #109https://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/117Cache loss and display it in the live_info widget2018-11-30T11:08:06ZBas NijholtCache loss and display it in the live_info widgetI've added caching of the loss and use it to diplay the loss in the `live_info` widget.
Calculating the loss could be an "expensive" calculation and in this way, no time is wasted.
![Screenshot_2018-10-08_at_13.18.21](/uploads/775ab874...I've added caching of the loss and use it to diplay the loss in the `live_info` widget.
Calculating the loss could be an "expensive" calculation and in this way, no time is wasted.
![Screenshot_2018-10-08_at_13.18.21](/uploads/775ab874f306a8a2c345903b9a878317/Screenshot_2018-10-08_at_13.18.21.png)Joseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/118add 'save' and 'load' to the learners and periodic saving to the Runner2018-11-30T11:08:06ZBas Nijholtadd 'save' and 'load' to the learners and periodic saving to the Runnertl;dr, this MR introduces:
* `learner.save`, `learner.load` that saves/loads **only** the data
* `learner.copy_from(other_learner)`
* `runner.start_periodic_saving(save_kwargs, interval)`
This adds saving and loading methods to t...tl;dr, this MR introduces:
* `learner.save`, `learner.load` that saves/loads **only** the data
* `learner.copy_from(other_learner)`
* `runner.start_periodic_saving(save_kwargs, interval)`
This adds saving and loading methods to the learner.
Now each learner has a `save` and `load` method that can be used to save and load **only** the data of a learner.
There are __two ways__ of naming the files:
1. Using the `fname` argument in `learner.save(fname=...)`
2. Setting the `fname` attribute, like `learner.fname = 'data/example.p` and then `learner.save()`
The second way _must be used_ when saving the `learner`s of a `BalancingLearner`.
By default the resulting pickle files are compressed, to turn this off use `learner.save(fname=..., compress=False)`
```python
learner = Learner2D(...)
learner.save(fname='filename.p')
learner = Learner2D(...)
learner.load(fname='filename.p')
```
in a `BalancingLearner` one can for example
```python
def combo_fname(val):
return '__'.join([f'{k}_{v}' for k, v in val.items()])
combos = adaptive.utils.named_product(a=[1, 2], b=[1])
learners = []
for combo in combos:
l = Learner(partial(f, combo=combo))
l.fname = combo_fname(combo)
learners.append(l)
learner = BalancingLearner(learners)
learner.load(folder='data_folder')
```
then the next time when you add more parameters to `combos`, the data will be loaded for the learners that have the data saved.
This also adds `leaner.copy_from(learner2)` to get a new learner with the same data where one (for example) uses different `bounds` or `loss_per_interval`.
Finally, it adds periodic saving while running with the `Runner`.
I've tested this over the last year in [`adaptive_tools`](https://github.com/basnijholt/adaptive-tools) and seems to work nicely for me.
Still need to
- [x] test with BalancingLearner
- [x] test with DataSaver
- [x] add doc-strings
- [x] add examples to the notebookJoseph WestonJoseph Westonhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/119(learnerND) no more (almost) flat simplices in the triangulation2018-11-30T11:08:06ZJorn Hoofwijk(learnerND) no more (almost) flat simplices in the triangulationfix bug that tiny volume simplices may occur on the surface of the
convex hull of a triangulation.
This change will make sure that all simplices which are (almost)
flat are never added. This is needed for some notebook I wrote
Closes #111fix bug that tiny volume simplices may occur on the surface of the
convex hull of a triangulation.
This change will make sure that all simplices which are (almost)
flat are never added. This is needed for some notebook I wrote
Closes #111Anton AkhmerovAnton Akhmerovhttps://gitlab.kwant-project.org/qt/adaptive/-/merge_requests/120add documentation2018-11-30T11:08:06ZJoseph Westonadd documentationCloses #91.Closes #91.