Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

How to speed up fminsearch ?

880 views
Skip to first unread message

Saikat Sengupta

unread,
Oct 24, 2010, 10:02:03 PM10/24/10
to
Hi,

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

Saikat Sengupta

unread,
Oct 24, 2010, 10:03:03 PM10/24/10
to

Marc

unread,
Oct 25, 2010, 1:03:04 AM10/25/10
to
As a student, you should show us what you have done so far. Sure there are many ways to speed up optimizations... But since you have not explained what you have done, I can not comment on how you should proceed.

Alan Weiss

unread,
Oct 25, 2010, 7:46:49 AM10/25/10
to
I don't really understand your problem, but perhaps I can point you to
the areas of documentation that can help you understand which routines
might apply.

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

Saikat Sengupta

unread,
Oct 25, 2010, 10:15:05 AM10/25/10
to
Thanks Alan. I'll look into the methods you suggested.


Alan Weiss <awe...@mathworks.com> wrote in message <ia3qn9$98k$1...@fred.mathworks.com>...

Saikat Sengupta

unread,
Oct 25, 2010, 10:40:07 AM10/25/10
to
Hi , Thanks for your reply.
Here's what I've done till now.

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>...

0 new messages