update sample3

This commit is contained in:
张壹 2021-06-02 15:38:37 +08:00
parent 71d0a5e3aa
commit 253b66d3c7

View File

@ -70,7 +70,7 @@ int TEST_FUNC::Progress(const lbfgsfloatval_t *x, const lbfgsfloatval_t *g, cons
const lbfgsfloatval_t xnorm, const lbfgsfloatval_t gnorm, const lbfgsfloatval_t step, const lbfgs_parameter_t param,
int n, int k, int ls)
{
clog << "iteration times: " << k << " fx = " << fx << " gnorm/xnorm = " << gnorm/xnorm << endl;
clog << "iteration times: " << k << " fx = " << fx << " gnorm/xnorm = " << gnorm/(xnorm>1.0?xnorm:1.0) << endl;
clog << x[0] << " " << x[1] << " " << x[2] << endl;
if (fx < 1e-10) return 1; //这里我们设置一个方程组的整体目标函数值作为终止条件 因为此方程组在0值处梯度不为0 无法使用梯度条件
@ -83,6 +83,7 @@ int TEST_FUNC::Routine()
lbfgs_parameter_t self_para;
lbfgs_parameter_init(&self_para);
self_para.past = 2;
//self_para.min_step = 1e-30;
//self_para.max_linesearch = 40;
//self_para.linesearch = LBFGS_LINESEARCH_BACKTRACKING_WOLFE;