我正在尝试最小化76个参数的功能。我希望每个参数值都在0到5之间。
默认算法LBFGS无法找到最优值。
因此,我尝试了TNC算法,虽然该算法实现了良好的目标函数值,但它给我的解决方案忽略了界限。它的输出似乎并不表明有任何故障。
x0 = np.zeros(2 * S)
bnds = tuple([(0,5)]*2*S)
r = scipy.optimize.minimize(mse, x0, method = 'TNC', bounds=bnds, callback=print_callback, options={'disp': True})
这是TNC优化的输出:
(prior_every_personb_mse_sg.py:8229): Gdk-CRITICAL **: 15:06:09.828: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
(prior_every_personb_mse_sg.py:8229): Gdk-CRITICAL **: 15:06:09.831: gdk_cursor_new_for_display: assertion 'GDK_IS_DISPLAY (display)' failed
NIT NF F GTG
0 1 2.544667777777778E+03 1.71075138E+22
tnc: fscale = 1.5291e-12
tnc: |xn-xn-1] = 9.73002e-10 -> convergence
1 27 1.862298888888889E+03 2.84054419E+22
tnc: Converged (|x_n-x_(n-1)| ~= 0)