How to implement linesearch in optimization algorithms?
40 ビュー (過去 30 日間)
古いコメントを表示
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 件のコメント
採用された回答
Harimurali
2023 年 9 月 8 日
編集済み: Harimurali
2023 年 9 月 8 日
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 件のコメント
Harimurali
2023 年 9 月 8 日
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.
その他の回答 (0 件)
参考
カテゴリ
Help Center および File Exchange で Get Started with Optimization Toolbox についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!