New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Underlying algorithm and MATLAB integration #175
Comments
Thank you for your interest. Most of the algorithms are of our own making except what is specified in the credits. We plan to write a paper that should be released around August. For now you could cite Zenodo where we have a DOI 10.5281/zenodo.1182437. If you experience any issues feel free to ask for support on Gitter chat or open an issue. |
Thanks for the information! Another reason that I asked abouth the algorithm is that my current codes are all in matlab, but this algorithm seems helpful(And migrate all my previous matlab function to python seems a big burden ). Therefore, I am thinking about translating this adaptive learner to matlab. My current case is very simple 1D, R->R. So that's why I want to know more about the algorithm. |
Adaptive excels in doing the calculation in parallel while being able to live-plot your data. This functionality won't be (easily or at all) portable to MATLAB. Another benefit of using Adaptive is that one can easily adjust the sampling strategy by specifying another loss function, see this. I would not recommend porting the code over because this will take an unreasonable amount of time. Rather, maybe you could call MATLAB code from Python. Without the live-plotting and parallelism, your code would just be: import adaptive
def goal(learner):
return learner.loss() < 0.01
adaptive.Learner1D(
function=lambda _:_, # you won't need to put the function here, because you would have it in MATLAB
bounds=(-1, 1), # the bounds in between which you want to learn the function
)
while not goal(learner):
points, loss_improvements = learner.ask(1) # you don't need to use the `loss_improvements`
x = points[0]
value = calculation_in_matlab(x) # This is the function you would need to implement.
learner.tell((point, value)) If you would really be able to create a function with that exact interface ( |
Cool! Thanks for your advice! |
Maybe one last question please.. I find I can surely call matlab function from Python, but when I set a lambda function for Here is a minimal example,
Now I call matlab function from python, the code is:
You may try to type But, I found that |
Please give more information about how you're running adaptive (jupyter notebook or regular python script?). |
Hi Weston, Thanks for your package and great talk in Maryland again! I just use jupyter notebook on Windows 10. Python 3.6.(Because Matlab engine API for Python at most support 3.6). Matlab version is 2018a. Basically, every native function defined in python is working properly but the function that calling external matlab function fails. (Please see the above minimal example) |
Could you try the "simple runner" like It might not work because of the parallelism. |
Thanks. Cange to simple runner now works |
Would it be possible to elaborate on the underlying algorithm or refer to some papers so that I can properly cite it?
The text was updated successfully, but these errors were encountered: