How to implement linesearch in optimization algorithms?
36 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
Olawale Oyewole
am 13 Jul. 2023
Kommentiert: Olawale Oyewole
am 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 Kommentare
Akzeptierte Antwort
Harimurali
am 8 Sep. 2023
Bearbeitet: Harimurali
am 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 Kommentare
Harimurali
am 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.
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Get Started with Optimization Toolbox finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!