optimization, Bosted difference of convex functions algorithm, Mathematics

12 ビュー (過去 30 日間)
Ammar Na
Ammar Na 2022 年 7 月 12 日
Hello dear freinds,
I wish to get help for my code here. I am coding an algorithm, that called BDCA which is an improvment of the DCA. The first algorithm should improve the first one, but this is not happend in my code and I do not know why.
The algorithm is
Taking x_{0} as any initial condition and k=0. Fix \alpha >0 and \beta \in (0,1) \\
Select s_{k}\in \partial g(x_{k}) and compute y_k by solving (1)
\underset{x\in \mathbb{R}^n}{\min} \quad \phi_{k}(x):= f(x) - (g(x^2_{k})+s^T_{k}(x^2-x^2_{k})).
Set d_{k,i}= 0, if, y_{k,i}=0, \\ else, d_{k,i}= \frac{y^2_{k,i}-x^2_{k,i}}{2y_{k,i}} &
If $d_{k,i}=0$ : Stop and return $x_{k}$. Otherwise go to the next step.
Compute stepsize t_{k}:=\max \{\beta^l | l=0,1,2...\} s.t.
\phi(y_{k}+t_{k}d_{k})\leq \phi(y_{k})-\alpha t^2_{k}{\lVert d_{k}\rVert}^2\\
Set x_{k+1}=y_{k}+t_{k}d_{k},\\
\State k \gets k+1 and go to 1.
I hope that the algorithm is understanadable, so this Alg has a line search to improve the DCA mentioned before, but I am still getting exactly the same result. I hope some code tell me what I am doing wrong in the following code:
for i=1:N
if u(i)==0
d(i)=0;
else
d(i)=((u(i)^2)-(u_old(i)^2))/(2*u(i));
end
end
if sum(abs(d))==0
u=u_old;
break
else
phi_u=@(u)1/2*(u'*M*u)-(transpose(B)*u)+sum_g(u);
t=1;
while phi_u(u+t*d) > phi_u(u) - alpha *(t^2)* power ( norm (d), 2)
t=0.5*t;
%if t < 1*e -30 % No decrease found
if t < 0.001 % No decrease found
break ;
end
u_k=u+t*d;
if u_old==u_k
u = u_old;
break
else
u_old=u_k;
end
end
end

回答 (0 件)

カテゴリ

Help Center および File ExchangeSurrogate Optimization についてさらに検索

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by