亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? lbfgs.c

?? This library is a C port of the implementation of Limited-memory Broyden-Fletcher-Goldfarb-Shanno (L
?? C
?? 第 1 頁 / 共 3 頁
字號:
        /* Store the current position and gradient vectors. */        veccpy(xp, x, n);        veccpy(gp, g, n);        /* Search for an optimal step. */        if (param.orthantwise_c == 0.) {            ls = linesearch(n, x, &fx, g, d, &step, xp, gp, w, &cd, &param);        } else {            ls = linesearch(n, x, &fx, g, d, &step, xp, pg, w, &cd, &param);            owlqn_pseudo_gradient(                pg, x, g, n,                param.orthantwise_c, param.orthantwise_start, param.orthantwise_end                );        }        if (ls < 0) {            /* Revert to the previous point. */            veccpy(x, xp, n);            veccpy(g, gp, n);            ret = ls;            goto lbfgs_exit;        }        /* Compute x and g norms. */        vec2norm(&xnorm, x, n);        if (param.orthantwise_c == 0.) {            vec2norm(&gnorm, g, n);        } else {            vec2norm(&gnorm, pg, n);        }        /* Report the progress. */        if (cd.proc_progress) {            if (ret = cd.proc_progress(cd.instance, x, g, fx, xnorm, gnorm, step, cd.n, k, ls)) {                goto lbfgs_exit;            }        }        /*            Convergence test.            The criterion is given by the following formula:                |g(x)| / \max(1, |x|) < \epsilon         */        if (xnorm < 1.0) xnorm = 1.0;        if (gnorm / xnorm <= param.epsilon) {            /* Convergence. */            ret = LBFGS_SUCCESS;            break;        }        /*            Test for stopping criterion.            The criterion is given by the following formula:                (f(past_x) - f(x)) / f(x) < \delta         */        if (pf != NULL) {            /* We don't test the stopping criterion while k < past. */            if (param.past <= k) {                /* Compute the relative improvement from the past. */                rate = (pf[k % param.past] - fx) / fx;                /* The stopping criterion. */                if (rate < param.delta) {                    ret = LBFGS_STOP;                    break;                }            }            /* Store the current value of the objective function. */            pf[k % param.past] = fx;        }        if (param.max_iterations != 0 && param.max_iterations < k+1) {            /* Maximum number of iterations. */            ret = LBFGSERR_MAXIMUMITERATION;            break;        }        /*            Update vectors s and y:                s_{k+1} = x_{k+1} - x_{k} = \step * d_{k}.                y_{k+1} = g_{k+1} - g_{k}.         */        it = &lm[end];        vecdiff(it->s, x, xp, n);        vecdiff(it->y, g, gp, n);        /*            Compute scalars ys and yy:                ys = y^t \cdot s = 1 / \rho.                yy = y^t \cdot y.            Notice that yy is used for scaling the hessian matrix H_0 (Cholesky factor).         */        vecdot(&ys, it->y, it->s, n);        vecdot(&yy, it->y, it->y, n);        it->ys = ys;        /*            Recursive formula to compute dir = -(H \cdot g).                This is described in page 779 of:                Jorge Nocedal.                Updating Quasi-Newton Matrices with Limited Storage.                Mathematics of Computation, Vol. 35, No. 151,                pp. 773--782, 1980.         */        bound = (m <= k) ? m : k;        ++k;        end = (end + 1) % m;        /* Compute the steepest direction. */        if (param.orthantwise_c == 0.) {            /* Compute the negative of gradients. */            vecncpy(d, g, n);        } else {            vecncpy(d, pg, n);        }        j = end;        for (i = 0;i < bound;++i) {            j = (j + m - 1) % m;    /* if (--j == -1) j = m-1; */            it = &lm[j];            /* \alpha_{j} = \rho_{j} s^{t}_{j} \cdot q_{k+1}. */            vecdot(&it->alpha, it->s, d, n);            it->alpha /= it->ys;            /* q_{i} = q_{i+1} - \alpha_{i} y_{i}. */            vecadd(d, it->y, -it->alpha, n);        }        vecscale(d, ys / yy, n);        for (i = 0;i < bound;++i) {            it = &lm[j];            /* \beta_{j} = \rho_{j} y^t_{j} \cdot \gamma_{i}. */            vecdot(&beta, it->y, d, n);            beta /= it->ys;            /* \gamma_{i+1} = \gamma_{i} + (\alpha_{j} - \beta_{j}) s_{j}. */            vecadd(d, it->s, it->alpha - beta, n);            j = (j + 1) % m;        /* if (++j == m) j = 0; */        }        /*            Constrain the search direction for orthant-wise updates.         */        if (param.orthantwise_c != 0.) {            for (i = param.orthantwise_start;i < param.orthantwise_end;++i) {                if (d[i] * pg[i] >= 0) {                    d[i] = 0;                }            }        }        /*            Now the search direction d is ready. We try step = 1 first.         */        step = 1.0;    }lbfgs_exit:    /* Return the final value of the objective function. */    if (ptr_fx != NULL) {        *ptr_fx = fx;    }    vecfree(pf);    /* Free memory blocks used by this function. */    if (lm != NULL) {        for (i = 0;i < m;++i) {            vecfree(lm[i].s);            vecfree(lm[i].y);        }        vecfree(lm);    }    vecfree(pg);    vecfree(w);    vecfree(d);    vecfree(gp);    vecfree(g);    vecfree(xp);    return ret;}static int line_search_backtracking(    int n,    lbfgsfloatval_t *x,    lbfgsfloatval_t *f,    lbfgsfloatval_t *g,    lbfgsfloatval_t *s,    lbfgsfloatval_t *stp,    const lbfgsfloatval_t* xp,    const lbfgsfloatval_t* gp,    lbfgsfloatval_t *wp,    callback_data_t *cd,    const lbfgs_parameter_t *param    ){    int ret = 0, count = 0;    lbfgsfloatval_t width, dg, norm = 0.;    lbfgsfloatval_t finit, dginit = 0., dgtest;    const lbfgsfloatval_t wolfe = 0.9, dec = 0.5, inc = 2.1;    /* Check the input parameters for errors. */    if (*stp <= 0.) {        return LBFGSERR_INVALIDPARAMETERS;    }    /* Compute the initial gradient in the search direction. */    vecdot(&dginit, g, s, n);    /* Make sure that s points to a descent direction. */    if (0 < dginit) {        return LBFGSERR_INCREASEGRADIENT;    }    /* The initial value of the objective function. */    finit = *f;    dgtest = param->ftol * dginit;    for (;;) {        veccpy(x, xp, n);        vecadd(x, s, *stp, n);        /* Evaluate the function and gradient values. */        *f = cd->proc_evaluate(cd->instance, x, g, cd->n, *stp);        ++count;        if (*f <= finit + *stp * dgtest) {            /* The sufficient decrease condition. */            if (param->linesearch == LBFGS_LINESEARCH_BACKTRACKING_STRONG) {                /* Check the strong Wolfe condition. */                vecdot(&dg, g, s, n);                if (dg > -wolfe * dginit) {                    width = dec;                } else if (dg < wolfe * dginit) {                    width = inc;                } else {                    /* Strong Wolfe condition. */                    return count;                }            } else {                /* Exit with the loose Wolfe condition. */                return count;            }        } else {            width = dec;        }        if (*stp < param->min_step) {            /* The step is the minimum value. */            return LBFGSERR_MINIMUMSTEP;        }        if (*stp > param->max_step) {            /* The step is the maximum value. */            return LBFGSERR_MAXIMUMSTEP;        }        if (param->max_linesearch <= count) {            /* Maximum number of iteration. */            return LBFGSERR_MAXIMUMLINESEARCH;        }        (*stp) *= width;    }}static int line_search_backtracking_owlqn(    int n,    lbfgsfloatval_t *x,    lbfgsfloatval_t *f,    lbfgsfloatval_t *g,    lbfgsfloatval_t *s,    lbfgsfloatval_t *stp,    const lbfgsfloatval_t* xp,    const lbfgsfloatval_t* gp,    lbfgsfloatval_t *wp,    callback_data_t *cd,    const lbfgs_parameter_t *param    ){    int i, ret = 0, count = 0;    lbfgsfloatval_t width = 0.5, norm = 0.;    lbfgsfloatval_t finit = *f, dgtest;    /* Check the input parameters for errors. */    if (*stp <= 0.) {        return LBFGSERR_INVALIDPARAMETERS;    }    /* Choose the orthant for the new point. */    for (i = 0;i < n;++i) {        wp[i] = (xp[i] == 0.) ? -gp[i] : xp[i];    }    for (;;) {        /* Update the current point. */        veccpy(x, xp, n);        vecadd(x, s, *stp, n);        /* The current point is projected onto the orthant. */        owlqn_project(x, wp, param->orthantwise_start, param->orthantwise_end);        /* Evaluate the function and gradient values. */        *f = cd->proc_evaluate(cd->instance, x, g, cd->n, *stp);        /* Compute the L1 norm of the variables and add it to the object value. */        norm = owlqn_x1norm(x, param->orthantwise_start, param->orthantwise_end);        *f += norm * param->orthantwise_c;        ++count;        dgtest = 0.;        for (i = 0;i < n;++i) {            dgtest += (x[i] - xp[i]) * gp[i];        }        if (*f <= finit + param->ftol * dgtest) {            /* The sufficient decrease condition. */            return count;        }        if (*stp < param->min_step) {            /* The step is the minimum value. */            return LBFGSERR_MINIMUMSTEP;        }        if (*stp > param->max_step) {            /* The step is the maximum value. */            return LBFGSERR_MAXIMUMSTEP;        }        if (param->max_linesearch <= count) {            /* Maximum number of iteration. */            return LBFGSERR_MAXIMUMLINESEARCH;        }        (*stp) *= width;    }}static int line_search_morethuente(    int n,    lbfgsfloatval_t *x,    lbfgsfloatval_t *f,    lbfgsfloatval_t *g,    lbfgsfloatval_t *s,    lbfgsfloatval_t *stp,    const lbfgsfloatval_t* xp,    const lbfgsfloatval_t* gp,    lbfgsfloatval_t *wa,    callback_data_t *cd,    const lbfgs_parameter_t *param    ){    int count = 0;    int brackt, stage1, uinfo = 0;    lbfgsfloatval_t dg;    lbfgsfloatval_t stx, fx, dgx;    lbfgsfloatval_t sty, fy, dgy;    lbfgsfloatval_t fxm, dgxm, fym, dgym, fm, dgm;    lbfgsfloatval_t finit, ftest1, dginit, dgtest;    lbfgsfloatval_t width, prev_width;    lbfgsfloatval_t stmin, stmax;    /* Check the input parameters for errors. */    if (*stp <= 0.) {        return LBFGSERR_INVALIDPARAMETERS;    }    /* Compute the initial gradient in the search direction. */    vecdot(&dginit, g, s, n);    /* Make sure that s points to a descent direction. */    if (0 < dginit) {        return LBFGSERR_INCREASEGRADIENT;    }    /* Initialize local variables. */    brackt = 0;    stage1 = 1;    finit = *f;    dgtest = param->ftol * dginit;    width = param->max_step - param->min_step;    prev_width = 2.0 * width;    /*        The variables stx, fx, dgx contain the values of the step,        function, and directional derivative at the best step.        The variables sty, fy, dgy contain the value of the step,        function, and derivative at the other endpoint of        the interval of uncertainty.        The variables stp, f, dg contain the values of the step,        function, and derivative at the current step.    */    stx = sty = 0.;    fx = fy = finit;    dgx = dgy = dginit;    for (;;) {        /*            Set the minimum and maximum steps to correspond to the            present interval of uncertainty.         */        if (brackt) {            stmin = min2(stx, sty);            stmax = max2(stx, sty);        } else {            stmin = stx;            stmax = *stp + 4.0 * (*stp - stx);        }        /* Clip the step in the range of [stpmin, stpmax]. */        if (*stp < param->min_step) *stp = param->min_step;        if (param->max_step < *stp) *stp = param->max_step;        /*            If an unusual termination is to occur then let            stp be the lowest point obtained so far.         */        if ((brackt && ((*stp <= stmin || stmax <= *stp) || param->max_linesearch <= count + 1 || uinfo != 0)) || (brackt && (stmax - stmin <= param->xtol * stmax))) {            *stp = stx;        }        /*            Compute the current value of x:                x <- x + (*stp) * s.         */        veccpy(x, xp, n);        vecadd(x, s, *stp, n);        /* Evaluate the function and gradient values. */        *f = cd->proc_evaluate(cd->instance, x, g, cd->n, *stp);        vecdot(&dg, g, s, n);        ftest1 = finit + *stp * dgtest;        ++count;        /* Test for errors and convergence. */        if (brackt && ((*stp <= stmin || stmax <= *stp) || uinfo != 0)) {            /* Rounding errors prevent further progress. */            return LBFGSERR_ROUNDING_ERROR;        }        if (*stp == param->max_step && *f <= ftest1 && dg <= dgtest) {            /* The step is the maximum value. */            return LBFGSERR_MAXIMUMSTEP;        }        if (*stp == param->min_step && (ftest1 < *f || dgtest <= dg)) {            /* The step is the minimum value. */            return LBFGSERR_MINIMUMSTEP;

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日本精品一区二区三区高清| 久久久久亚洲蜜桃| 日韩欧美专区在线| 国产精品久久久久桃色tv| 午夜欧美电影在线观看| 成人h动漫精品一区二区| 4438x成人网最大色成网站| 国产精品丝袜久久久久久app| 日韩精品每日更新| 色婷婷国产精品综合在线观看| 欧美精品一区二区三区在线| 亚洲va欧美va人人爽| 国产91在线观看| 精品免费国产一区二区三区四区| 有坂深雪av一区二区精品| 国产成人精品综合在线观看| 7777女厕盗摄久久久| 有码一区二区三区| 91在线视频免费观看| 国产亚洲精品超碰| 国内精品在线播放| 制服.丝袜.亚洲.另类.中文 | 亚洲黄色小说网站| 9l国产精品久久久久麻豆| 精品免费视频.| 麻豆精品在线视频| 91精品国产综合久久香蕉的特点 | 欧美大胆一级视频| 日韩在线观看一区二区| 欧美日韩在线三级| 夜色激情一区二区| 欧美三级电影网站| 亚洲第一久久影院| 欧美另类一区二区三区| 亚洲成人动漫在线观看| 欧美日韩五月天| 丝袜美腿亚洲综合| 69堂成人精品免费视频| 蜜臀av一级做a爰片久久| 91麻豆精品国产91| 蜜桃久久久久久久| 26uuu亚洲| 成人天堂资源www在线| 国产精品免费视频一区| 欧美一区欧美二区| 午夜精品久久久久久久蜜桃app| 在线免费观看日本欧美| 亚洲精品视频在线看| 日本道色综合久久| 亚洲综合清纯丝袜自拍| 欧美精品 日韩| 韩国一区二区在线观看| 国产午夜精品久久久久久久 | 国产精品一级在线| 国产精品入口麻豆原神| 色婷婷av久久久久久久| 天天综合网 天天综合色| 欧美不卡一区二区三区| 国产激情视频一区二区在线观看 | 欧美亚洲一区二区在线观看| 亚洲一区二区三区视频在线| 制服丝袜一区二区三区| 国产一区二区三区日韩| 亚洲人成在线播放网站岛国| 在线欧美一区二区| 久久99热这里只有精品| 国产精品乱码一区二区三区软件| 91国偷自产一区二区三区成为亚洲经典 | 国产亚洲视频系列| 一本到三区不卡视频| 偷拍亚洲欧洲综合| 国产日韩欧美a| 欧美揉bbbbb揉bbbbb| 捆绑紧缚一区二区三区视频| 国产精品不卡一区| 日韩欧美aaaaaa| 日本精品裸体写真集在线观看| 老司机精品视频一区二区三区| 国产精品久久午夜夜伦鲁鲁| 欧美精品丝袜久久久中文字幕| 国产 日韩 欧美大片| 亚洲成人av福利| 国产精品美女久久久久高潮| 欧美精品一二三四| 91麻豆国产香蕉久久精品| 精品综合免费视频观看| 一区二区在线看| 久久精品亚洲麻豆av一区二区| 欧美亚州韩日在线看免费版国语版| 国产一区不卡精品| 五月婷婷综合激情| 亚洲女同一区二区| 国产精品免费人成网站| 欧美变态凌虐bdsm| 欧美日韩国产小视频在线观看| 成人激情午夜影院| 国产一区二三区好的| 日韩精品视频网| 一个色妞综合视频在线观看| 国产精品午夜电影| 久久久不卡网国产精品一区| 日韩欧美资源站| 欧美一区二区福利视频| 欧美日韩精品专区| 在线一区二区观看| 91麻豆国产香蕉久久精品| 成人午夜av电影| 国产91精品一区二区| 国产精品一二三区在线| 极品少妇xxxx精品少妇| 麻豆精品一区二区三区| 日本亚洲欧美天堂免费| 香蕉av福利精品导航| 亚洲一区二区三区四区五区中文| 亚洲免费av在线| 最好看的中文字幕久久| 亚洲欧美精品午睡沙发| 亚洲人成在线播放网站岛国| 亚洲欧美偷拍三级| **欧美大码日韩| 亚洲欧美日韩中文播放| 亚洲精品伦理在线| 亚洲高清免费观看高清完整版在线观看 | 日韩一区二区三| 日韩视频一区二区在线观看| 日韩你懂的电影在线观看| 日韩精品中文字幕在线不卡尤物| 欧美成人aa大片| 国产日韩欧美精品在线| 中文字幕亚洲一区二区av在线| 18涩涩午夜精品.www| 亚洲一区二区三区三| 日本亚洲最大的色成网站www| 久久精品久久99精品久久| 国产精品亚洲一区二区三区在线| 成人性色生活片免费看爆迷你毛片| www.亚洲色图.com| 欧美日韩精品一区二区三区| 欧美一卡二卡三卡| 欧美国产一区二区在线观看| 亚洲麻豆国产自偷在线| 日韩制服丝袜av| 国产成人自拍网| 91久久奴性调教| 日韩欧美一级在线播放| 国产欧美日韩另类视频免费观看| 成人欧美一区二区三区小说| 天天影视色香欲综合网老头| 久久精品国产999大香线蕉| 粉嫩嫩av羞羞动漫久久久| 在线精品亚洲一区二区不卡| 欧美成人欧美edvon| 国产精品免费久久| 美日韩一级片在线观看| 成人av在线看| 欧美一级久久久久久久大片| 亚洲国产精品国自产拍av| 亚洲va韩国va欧美va| 国产黄色成人av| 欧美精品亚洲一区二区在线播放| 久久久久久综合| 午夜久久久影院| 成人黄页在线观看| 欧美一区二区三区视频免费| 中文字幕 久热精品 视频在线 | 成人av在线观| 日韩亚洲欧美综合| 亚洲欧美日韩人成在线播放| 久久99国产精品久久| 在线观看av一区| 国产精品日韩精品欧美在线| 午夜精品福利一区二区三区av| 高潮精品一区videoshd| 欧美一区二区精品在线| 亚洲一区二区欧美| 成人h动漫精品一区二区| 欧美大片在线观看一区二区| 亚洲影视在线播放| 91天堂素人约啪| 国产免费成人在线视频| 精品中文字幕一区二区小辣椒| 欧美日韩国产精选| 亚洲一区在线观看视频| 波多野洁衣一区| 国产日韩欧美精品在线| 韩国三级在线一区| 日韩免费高清av| 天天做天天摸天天爽国产一区| 91黄视频在线| 亚洲免费毛片网站| 91麻豆国产福利在线观看| 国产精品久久福利| 成人午夜视频免费看| 国产亚洲精品精华液| 国产成人免费在线观看| 久久久久88色偷偷免费| 国产一区二区久久| 久久―日本道色综合久久| 狠狠色狠狠色合久久伊人| 精品免费视频.|