python - scipy.optimize.minimize 使用 L-BFGS-B 返回 ABNORMAL_TERMINATION_IN_LNSRCH
问题描述
我正在使用 scipy.optimize.minimize 来求解/计算 314 次仿射变换中的 3768 个变量,以将一个点云转换为另一个 eval_fun,首先我尝试使用 scipy.optimize.fmin_l_bfgs_b 和 approx_grad 来避免实现渐变,但它一直因 ABNORMAL_TERMINATION_IN_LNSRCH 而崩溃。然后我实现了梯度函数并开始使用最小化,它仍然崩溃并出现同样的错误。
res = minimize(eval_func,
x0=np.array(M),
method='L-BFGS-B',
args=(scan_pts, scan_fce, scan_nrm, scan_mar, temp_pts, temp_fce, temp_nrm, temp_mar, alfa, beta, gama,edges),
options={'iprint' : 99, 'maxiter' : 100}, jac=True)
这是完整的输出:
This problem is unconstrained.
Line search cannot locate an adequate point after 20 function
and gradient evaluations. Previous x, f and g restored.
Possible causes: 1 error in function or gradient evaluation;
2 rounding error dominate computation.
RUNNING THE L-BFGS-B CODE
* * *
Machine precision = 2.220D-16
N = 3768 M = 10
At X0 0 variables are exactly at the bounds
At iterate 0 f= 1.88129D-01 |proj g|= 9.98119D-01
ITERATION 1
---------------- CAUCHY entered-------------------
There are 0 breakpoints
GCP found in this segment
Piece 1 --f1, f2 at start point -9.3847D+02 9.3847D+02
Distance to the stationary point = 1.0000D+00
---------------- exit CAUCHY----------------------
3768 variables are free at GCP 1
* * *
Tit = total number of iterations
Tnf = total number of function evaluations
Tnint = total number of segments explored during Cauchy searches
Skip = number of BFGS updates skipped
Nact = number of active bounds at final generalized Cauchy point
Projg = norm of the final projected gradient
F = final function value
* * *
N Tit Tnf Tnint Skip Nact Projg F
3768 1 21 1 0 0 9.981D-01 1.881D-01
F = 0.18812870968000006
ABNORMAL_TERMINATION_IN_LNSRCH
我尝试按照此处所述更改所有值: scipy.optimize.fmin_l_bfgs_b 返回 'ABNORMAL_TERMINATION_IN_LNSRCH'但它们都不起作用
我能做些什么?
解决方案
推荐阅读
- c# - 带有来自父数据集的子报告的 RDLC 报告?
- c# - 如何使用包含“。”的键反序列化 json 在 C# 中?
- php - 从 instagram hashtag 中获取数据属性
- html - 在标题中嵌入 Bootstrap 3 导航栏
- dask - Dask数据框获得第二高的值和列名
- angular - 运行“纱线受影响的深度图”时获取“提供的无效选项”
- php - PHP 无法从 mysqli 语句中读取第二个结果集
- postgresql - 无法导入模块“abc”:/var/task/psycopg2/_psycopg.so:ELF 文件的 phentsize 不是预期的大小
- java - 如何xpath在下拉列表中选择文本
- excel - 尽管在 excel 工作表中有匹配项,但 Application.Match 函数为何无法正常工作?