import optimtool as oo
from optimtool.base import np, sp, plt
pip install optimtool>=2.5.0
混合优化算法(optimtool.hybrid)
import optimtool.hybrid as oh
oh.[方法名].[函数名]([目标函数], [参数表], [初始迭代点], [正则化参数], [邻近算子名])
ϕ ( x ) = f ( x ) + h ( x ) \phi(x) = f(x) + h(x) ϕ(x)=f(x)+h(x)
其中 f ( x ) f(x) f(x)是可微的。 h ( x ) h(x) h(x)不是可微的,并且具备简单的形式。optimtool.hybrid能够选择的 h ( x ) h(x) h(x)有: ∣ ∣ x ∣ ∣ 1 ||x||_1 ∣∣x∣∣1, ∣ ∣ x ∣ ∣ 2 ||x||_2 ∣∣x∣∣2, − ∑ i ln ( x i ) -\sum_{i}{\ln(x_i)} −∑iln(xi),实例:
f ( x ) = ∑ i = 1 n ( ( n − ∑ j = 1 n cos x j ) + i ( 1 − cos x i ) − sin x i ) 2 , x 0 = [ 0.2 , 0.2 , . . . , 0.2 ] f(x)=\sum_{i=1}^{n}((n-\sum_{j=1}^{n}\cos x_j)+i(1-\cos x_i)-\sin x_i)^2, x_0=[0.2, 0.2, ...,0.2] f(x)=i=1∑n((n−