|
| 1 | +FAQ: frequently asked questions |
| 2 | +------------------------------- |
| 3 | + |
| 4 | +How do I get the data? |
| 5 | +~~~~~~~~~~~~~~~~~~~~~~ |
| 6 | + |
| 7 | +Check ``learner.data``. |
| 8 | + |
| 9 | + |
| 10 | +How do I learn more than one value per point? |
| 11 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 12 | + |
| 13 | +Use the `adaptive.DataSaver`. |
| 14 | + |
| 15 | + |
| 16 | +My runner failed, how do I get the error message? |
| 17 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 18 | + |
| 19 | +Check ``runner.task.print_stack()``. |
| 20 | + |
| 21 | + |
| 22 | +How do I get a `~adaptive.Learner2D`\'s data on a grid? |
| 23 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 24 | + |
| 25 | +Use ``learner.interpolated_on_grid()`` optionally with a argument ``n`` to specify the the amount of points in ``x`` and ``y``. |
| 26 | + |
| 27 | + |
| 28 | +Why can I not use a ``lambda`` with a learner? |
| 29 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 30 | + |
| 31 | +When using the `~adaptive.Runner` the learner's function is evaluated in different Python processes. |
| 32 | +Therefore, the ``function`` needs to be serialized (pickled) and send to the other Python processes; ``lambda``\s cannot be pickled. |
| 33 | +Instead you can probably use ``functools.partial`` to accomplish what you want to do. |
| 34 | + |
| 35 | +Where can I learn more about the algorithm used? |
| 36 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 37 | + |
| 38 | +Read our `draft paper <https://gitlab.kwant-project.org/qt/adaptive-paper/builds/artifacts/master/file/paper.pdf?job=make>`_ or the source code on `GitHub <https://github.com/python-adaptive/adaptive/>`_. |
| 39 | + |
| 40 | + |
| 41 | +How do I run multiple runners? |
| 42 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 43 | + |
| 44 | +Check out `Adaptive scheduler <http://adaptive-scheduler.readthedocs.io>`_, which solves the following problem of needing to run more learners than you can run with a single runner. |
| 45 | +It easily runs on tens of thousands of cores. |
| 46 | + |
| 47 | + |
| 48 | +What is the difference with FEM? |
| 49 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 50 | + |
| 51 | +The main difference with FEM (Finite Element Method) is that one needs to globally update the mesh at every time step. |
| 52 | + |
| 53 | +For Adaptive, we want to be able to parallelize the function evaluation and that requires an algorithm that can quickly return a new suggested point. |
| 54 | +This means that, to minimize the time that Adaptive spends on adding newly calculated points to the data strucute, we only want to update the data of the points that are close to the new point. |
| 55 | + |
| 56 | + |
| 57 | +What is the difference with Bayesian optimization? |
| 58 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 59 | + |
| 60 | +Indeed there are similarities between what Adaptive does and Bayesian optimization. |
| 61 | + |
| 62 | +The choice of new points is based on the previous ones. |
| 63 | + |
| 64 | +There is a tuneable algorithm for performing this selection, and the easiest way to formulate this algorithm is by defining a loss function. |
| 65 | + |
| 66 | +Bayesian optimization is a perfectly fine algorithm for choosing new points within adaptive. As an experiment we have interfaced ``scikit-optimize`` and implemented a learner that just wraps it. |
| 67 | + |
| 68 | +However there are important differences why Bayesian optimization doesn't cover all the needs. |
| 69 | +Often our aim is to explore the function and not minimize it. |
| 70 | +Further, Bayesian optimization is most often combined with Gaussian processes because it is then possible to compute the posteriour exactly and formulate a rigorous optimization strategy. |
| 71 | +Unfortunately Gaussian processes are computationally expensive and won't be useful with tens of thousands of points. |
| 72 | +Adaptive is much more simple-minded and it relies only on the local properties of the data, rather than fitting it globally. |
| 73 | + |
| 74 | +We'd say that Bayesian modeling is good for really computationally expensive data, regular grids for really cheap data, and local adaptive algorithms are somewhere in the middle. |
| 75 | + |
| 76 | +.. I get "``concurrent.futures.process.BrokenProcessPool``: A process in the process pool was terminated abruptly while the future was running or pending." what does it mean? |
| 77 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 78 | +
|
| 79 | + XXX: add answer! |
| 80 | +
|
| 81 | + What is the difference with Kriging? |
| 82 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 83 | +
|
| 84 | + XXX: add answer! |
| 85 | +
|
| 86 | +
|
| 87 | + What is the difference with adaptive meshing in CFD or computer graphics? |
| 88 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 89 | +
|
| 90 | + XXX: add answer! |
| 91 | +
|
| 92 | +
|
| 93 | + Can I use this to tune my hyper parameters for machine learning models? |
| 94 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 95 | +
|
| 96 | + XXX: add answer! |
| 97 | +
|
| 98 | +
|
| 99 | + How to use Adaptive with MATLAB? |
| 100 | + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 101 | +
|
| 102 | + XXX: add answer! |
| 103 | +
|
| 104 | +
|
| 105 | +Missing a question that you think belongs here? Let us `know <https://github.com/python-adaptive/adaptive/issues/new>`_. |
0 commit comments