tmp update

This commit is contained in:
张壹 2022-02-17 09:31:36 +08:00
parent e3f737fbc0
commit 9d31decd84
2 changed files with 3 additions and 1 deletions

View File

@ -651,8 +651,10 @@ int lbfgs(
veccpy(d, dp, n);
} else if (ys < yy) {
// 这里假设了初始的Hessian矩阵为单位阵乘以ys/yy
vecscale(d, ys / yy, n); // 适当缩放d的大小
} else {
// 假设初始的Hessian矩阵为 I + [(ys - yy)/tr(Yk)]diag(y2)
veccpy(y2, lm[end].y, n);
vecmul(y2, lm[end].y, n);
vecdot(&Yk, y2, y2, n);

View File

@ -187,7 +187,7 @@ int TEST_FUNC::Routine()
lbfgs_parameter_init(&self_para);
self_para.epsilon = 1e-7;
int ret = lbfgs(N, x, &fx, _Func, _Progress, this, &self_para, NULL);
int ret = lbfgs(N, x, &fx, _Func, _Progress, this, &self_para, _Precondition);
clog << endl << "L-BFGS optimization terminated with status: " << lbfgs_strerror(ret) << endl;
clog << "Maximal difference = " << max_diff(x, m, N) << endl;