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!