How to implement linesearch in optimization algorithms?
43 views (last 30 days)
Show older comments
Olawale Oyewole
on 13 Jul 2023
Commented: Olawale Oyewole
on 8 Sep 2023
I am trying to implement a linesearching procedure in an optimization algorithm. $\eta_n=\eta^{m_n}$ where $m_n$ is the smallest integer $m$ such that $\eta_n\|A(x)-A(y)\| \le \mu\|x-y\|.$ Please how do I execute this in function mode?
5 Comments
Accepted Answer
Harimurali
on 8 Sep 2023
Edited: Harimurali
on 8 Sep 2023
Hi Olawale,
I understand that you want to implement a line searching procedure for the given optimization algorithm. The error being shown while running the MATLAB code given in the comments is because in line 8, in the function call of A, you are calling the function F with a scalar value, but the function F expects a vector as an argument.
As for the implementation of the line searching procedure in MATLAB for the given optimization algorithm, where is the smallest integer m such that .
You can use a loop to increment the value of muntil the inequality is satisfied by following these steps:
- Let the initial value of m = 1
- In the loop, calculate the left-hand side of the inequality using the values provided for and the functions and
- If the inequality is satisfied, then the smallest value of m that is is obtained. Otherwise, m is incremented, and the loop continues until the inequality is satisfied
Hope this helps.
6 Comments
Harimurali
on 8 Sep 2023
I am not able to assess the logical correctness of this loop due to the multiple dependencies, which are the calls to the functions inner, A, B, F, and error. This looks very different from the equation you have provided in the question. As this loop is part of the implementation of the whole algorithm, there is a lot of coupling with the rest of the code. You could try to implement and run the loop separately and then integrate it with the rest of the code. Also, due to the scalar-vector conflict, I feel that a major rework of the code may be required.
More Answers (0)
See Also
Categories
Find more on Get Started with Optimization Toolbox in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!