You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that there is a bug with the call to gpufit within Matlab when including the user_info parameter. Using the included linear_1d model (which utilizes the user_info parameter), I created a simple program in Matlab to model the equation y=x from x=0 to x=10 and called gpufit on the data. This should return the parameters 0 and 1, but results in 4.3467 and 0.8711 instead.
Additionally, if I leave the user_info parameter empty when calling gpufit, it returns the correct values (since it uses x=point_index which would result in x from 0 to 10). This shows that there is a bug with the user_info parameter when calling gpufit from Matlab. A simple script showing this problem is included below.
x=0:10;
params=single([0;1]);
y=single(params(1)+params(2)*x'); % y=x;
tolerance=1e-9;
max_n_iterations=1000;
estimator_id = EstimatorID.LSE;
model_id = ModelID.LINEAR_1D;
init = single([0;1]); % should result in correct parameters with only 1 iteration
[parameters,states,chi_squares,n_iterations,time]=gpufit(y,[],model_id,init,tolerance,max_n_iterations,[],estimator_id,x);
%[parameters,states,chi_squares,n_iterations,time]=gpufit(y,[],model_id,init,tolerance,max_n_iterations,[],estimator_id,[]);
parameters
The text was updated successfully, but these errors were encountered:
The 1D linear model requires the user_info parameter to be of type single. Since the default type in Matlab is double, the expression x = 0:10 in your example defines x as double. Try x = single(0:10).
Figured it out eventually. It should say this in the Matlab documentation instead of saying "arbitrary type" since the other inputs explicitly say they need to be singles.
It seems that there is a bug with the call to gpufit within Matlab when including the user_info parameter. Using the included linear_1d model (which utilizes the user_info parameter), I created a simple program in Matlab to model the equation y=x from x=0 to x=10 and called gpufit on the data. This should return the parameters 0 and 1, but results in 4.3467 and 0.8711 instead.
Additionally, if I leave the user_info parameter empty when calling gpufit, it returns the correct values (since it uses x=point_index which would result in x from 0 to 10). This shows that there is a bug with the user_info parameter when calling gpufit from Matlab. A simple script showing this problem is included below.
The text was updated successfully, but these errors were encountered: