-
Notifications
You must be signed in to change notification settings - Fork 73
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
Vectorize greedy2_cross #66
Comments
Hello, fun = @(ind)ind(1);
tt = greedy2_cross([2;2;2], fun, 1e-6, 'vec', false)
As per the documentation in the header of greedy2_cross, vectorised functions must take a M x d matrix of indices, where d is the dimension, and M is the number of samples in the current cross step, and return a M x 1 matrix of corresponding function values. That is, each row of the input matrix is an index at which the function should be evaluated. |
Thanks for your reply. I think the |
Well, it looks to me that this is not an issue with greedy2_cross. It has a well-defined interface for both vectorised and unvectorised functions, which works with your actual test function (fun). It doesn't seem necessary to implement another vectorisation. If you want to understand why exactly your function doesn't work, you can debug it as usual, given the input and output specifications. For example, make sure it always takes an M x d matrix and returns a M x 1 matrix. |
I use your vectorize handle
from your dmrg_cross.m with a test function:
But it does not work. Error message in the command window:
where the function handle vectorized_code is
And then I call your greedy2_cross with
vec=true
:May I kindly ask if you could fix the bug? Since
fun
is simply enough without any of my interface. I guess it’s might be an intrinsic issue.The text was updated successfully, but these errors were encountered: