How to optimize a custom multi parameter function
6 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
For an image processing project I am trying to optimize input parameters to minimize the Root Mean Squared Error (RMSE) of a custom particle localization function. Where the function has multiple input parameters, a few constant inputs and the RMSE as the only output
I am trying to use the Optimization Toolbox with fcn2optimexpr to solve for this:
prob = optimproblem("Description","Particle localization RMSE", "ObjectiveSense","minimize")
x = optimvar('x','Type','integer','LowerBound',5,'UpperBound',25);
y= optimvar('y','Type','integer','LowerBound',-2,'UpperBound',2);
RMSE = fcn2optimexpr(@ImageProcessor,x, y, a, b, c);
prob.Objective = sum_RMSE
show(prob)
initialGuess.x = 11;
initialGuess.y = 0;
min_RMSE = solve(sum_RMSE, initialGuess)
% Check for incorrect argument data type or missing argument in call to function 'solve'.
I have followed this guide for the function to objective expression but the solve function returns the error commented out. Do I have to set initial guesses for the variables a,b and c as well?
0 comentarios
Respuestas (1)
Umang Pandey
el 6 de Oct. de 2023
Hi Luciano,
I understand that you are facing issue using the "solve" function.
You need to define the variables used as parameters within the "solve" function as symbolic variables (syms).
Refer the documentation for "solve" for more information:
Best,
Umang
0 comentarios
Ver también
Categorías
Más información sobre Problem-Based Optimization Setup en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!