I am solving an optimization such that my X has 9 elements. In my function, I am obtaining an image and calculating pixelwise gradients such that
A(row,col) = sum (Xi * Pi(row,col) ) ; where Pi are defined
Return value f(x) is Grad_sum = sum( Pixelwise Gradient (A));
I am currently using fminsearch for doing this, but it takes a long time.
Is there any quicker way of doing this. Can this be done using lsqlin ?
I am a student and not very familiar with the optimization routines. Thanks in advance for any help.
Saikat
If your problem is smooth (differentiable), you might have better luck
with fminunc from the Optimization Toolbox:
http://www.mathworks.com/help/toolbox/optim/ug/brhkghv-18.html#brhkghv-19
http://www.mathworks.com/help/toolbox/optim/ug/fminunc.html
If your problem is not smooth, try patternsearch from the Global
Optimization Toolbox (formerly Genetic Algorithm and Direct Search Toolbox):
http://www.mathworks.com/help/toolbox/gads/f6010.html
Good luck,
Alan Weiss
MATLAB mathematical toolbox documentation
Alan Weiss <awe...@mathworks.com> wrote in message <ia3qn9$98k$1...@fred.mathworks.com>...
X_0 = ones(9,1);
options=optimset('Display','iter','MaxIter',600);
coefficients = fminsearch(@Optimization_Function_Grad,X_0,options,Image);
function [grad_val ] = Optimization_Function_Grad(X,Image)
This function first gets a new Image, A such that
A(row,col) = Image (row, col) + sum (Xi * Pi(row,col) ) ; where Pi are defined
Return value f(x) is grad_val = sum ( Pixelwise Gradient (A));
I'm trying to minimise the sum of the Pixelwise gradients of the final image A .(grad_val) with respect to X.
I've tried different number of iterations, function evaluations and arbitray starting values, but even just 150 iterations takes a long time and doesnt give a good solution.
The solution gets better as i increase number of iterations, I was thinking if I can speed up fminsearch, I may be able to run more iterations and get a better solution.
Thanks for your help.
Saikat.
"Marc " <marc.s...@uop.com> wrote in message <ia3328$i3a$1...@fred.mathworks.com>...