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

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

?? cluster2.c

?? 聚類算法全集以及內附數據集
?? C
?? 第 1 頁 / 共 4 頁
字號:
    *prv = grd; }               /* note the current gradient */  else if (t < 0) {             /* if gradients have opposite signs */    *chg *= clset->shrink;      /* decrease the learning rate */    if (*chg < clset->minchg) *chg = clset->minchg;    *prv = 0; }                 /* suppress a change in the next step */  else {                        /* if one gradient is zero */    *prv = grd; }               /* only note the current gradient */  if (grd > 0) return  *chg;    /* return the parameter change */  if (grd < 0) return -*chg;    /* (use only sign of gradient) */  return 0;                     /* return 0 if gradient is 0 */}  /* _resilient() *//*--------------------------------------------------------------------*/static double _quick (CLSET *clset,                      double grd, double *prv, double *chg){                               /* --- quickprop analog */  double t;                     /* temporary buffer */  double m;                     /* maximal fraction of new derivative */    t = *prv -grd;                /* compute the change of the gradient */  if      (*chg *t >= 0)        /* if the parabola opens downwards, */    *chg = grd;                 /* do a standard update step */  else if (*prv > 0) {          /* if previous gradient was positive */    m = clset->growth /(clset->growth +1);    if (grd >= *prv *m)         /* if the growth factor would become */      *chg *= clset->growth;    /* too large, use the maximal factor */    else                        /* otherwise compute the factor */      *chg *= grd /t; }         /* for a jump to the minimum */  else if (*prv < 0) {          /* if previous gradients was negative */    m = clset->growth /(clset->growth +1);    if (grd <= *prv *m)         /* if the growth factor would become */      *chg *= clset->growth;    /* too large, use the maximal factor */    else                        /* otherwise compute the factor */      *chg *= grd /t; }         /* for a jump to the minimum */  else                          /* if this is the first update */    *chg = grd;                 /* do a standard update step */  if      (*chg >  clset->maxchg) *chg =  clset->maxchg; /* clamp */  else if (*chg < -clset->maxchg) *chg = -clset->maxchg; /* change */  *prv = grd;                   /* note the new gradient and */  return *chg;                  /* return the parameter change */}  /* _quick() *//*--------------------------------------------------------------------*/static UPDATEFN *_updatefn[] = {  /* CLS_NONE       0x00 */  _standard,  /* CLS_EXPAND     0x10 */  _expand,  /* CLS_MOMENTUM   0x20 */  _momentum,  /* CLS_ADPATIVE   0x30 */  _adaptive,  /* CLS_RESILIENT  0x40 */  _resilient,  /* CLS_QUICK      0x50 */  _quick,};                              /* list of update functions *//*--------------------------------------------------------------------*/static double _stdupd (CLSET *clset){                               /* --- standard update method */  int     i, n;                 /* loop variables */  int     type;                 /* cluster type flags */  CLUSTER *p;                   /* to traverse the clusters */  double  *s, *c;               /* to access the vectors */  double  max = 0, t, a = 0;    /* maximal change, buffers */  assert(clset);                /* check the function arguments */  type = clset->type;           /* get the cluster type flags */  for (p = clset->cls +(n = clset->clscnt); --n >= 0; ) {    --p;                        /* traverse the clusters */    if (type & CLS_WEIGHT)      /* -- if adaptable weights */      p->wgt = p->nw;           /* copy the new cluster weight */    if (p->d2 < 0) continue;    /* skip clusters not to be updated */    s = p->sum; c = p->ctr;     /* get aggregation vector and center */    for (i = clset->incnt; --i >= 0; ) {      t = fabs(s[i] -c[i]); if (t > max) max = t;      c[i] = s[i];              /* determine the maximal change and */    }                           /* copy the new center coordinates */    if (type & CLS_SIZE) {      /* if the cluster size is adaptable, */      a = 1; p->var = p->msd; } /* copy the new cluster size */    else {                      /* otherwise (fixed cluster size) */      a = p->var /p->msd; }     /* compute the rescaling factor */    p->scl = 1/a;               /* and its reciprocal value */    if (type & CLS_COVARS) {    /* -- if adaptable covariances */      mat_chinv(p->inv,p->inv); /* invert the new covariance matrix */      if (a != 1) {             /* if fixed cluster size */        mat_trmuls(p->smp, p->smp, MAT_UPPER, a);        mat_trmuls(p->inv, p->inv, MAT_UPPER, p->scl);      }                         /* rescale to the old cluster size */      mat_copy  (p->cov, p->smp, MAT_UPPER|MAT_NOTBUF);      mat_tr2sym(p->cov, p->cov, MAT_UPPER);  /* copy and complete */      mat_tr2sym(p->inv, p->inv, MAT_UPPER);  /* the cov. matrices */      mat_init(p->smp, MAT_ZERO, NULL); }     /* reset aggregation */    else if (type & CLS_VARS) { /* -- if adaptable variances */      for (i = clset->incnt; --i >= 0; ) {        t = a *mat_get(p->smp, i, i);        if (t < MINVAR) t = MINVAR;        if (t > MAXVAR) t = MAXVAR;        mat_set(p->cov, i, i,   t);        mat_set(p->inv, i, i, 1/t);    /* copy the new variances */      }                         /* compute the inverse variances */      mat_init(p->smp, MAT_RESET, NULL);      mat_diainit(p->smp, -1);} /* reset the aggregation matrix */    else {                      /* -- if isotropic variance */      mat_init(p->smp, MAT_RESET, NULL);      if (type & CLS_SIZE) mat_diainit(p->smp, -1);    }                           /* reset the aggregation matrix */  }                             /* and reinitialize the variances */  return max;                   /* return the maximal change */}  /* _stdupd() */              /* of a center coordinate *//*----------------------------------------------------------------------A special function is used for the standard version to avoid theunnecessary function call for each parameter update as well as theadditional matrix decompositions needed for a neural network update.----------------------------------------------------------------------*/static double _nnupd (CLSET *clset){                               /* --- neural network update methods */  int      i, k, n;             /* loop variables */  int      type;                /* cluster type flags */  CLUSTER  *p;                  /* to traverse the clusters */  double   *s, *c, *x, *b;      /* to access the vectors */  double   max = 0;             /* maximum change of a parameter */  double   det, var;            /* determinant and isotropic variance */  double   t, d, v, u, a;       /* temporary buffers */  UPDATEFN *update;             /* parameter update function */  assert(clset);                /* check the function arguments */  type = clset->type;           /* get the cluster type flags */  for (p = clset->cls +(n = clset->clscnt); --n >= 0; ) {    --p;                        /* traverse the clusters */    /* -- update the cluster weight -- */    if (type & CLS_WEIGHT)      /* if adaptable cluster weights, */      p->wgt = p->nw;           /* copy the new cluster weight */    if (p->d2 < 0) continue;    /* skip clusters not to be updated */    /* -- update the cluster center -- */    update = _updatefn[(clset->method & CLS_MODIFIER) >> 4];    s = p->sum; c = p->ctr;     /* get aggregation vector, center, */    x = p->chc; b = p->bfc;     /* and the parameter vectors */    for (i = clset->incnt; --i >= 0; ) {      d = s[i] -c[i];           /* compute the center gradient */      t = fabs(d); if (t > max) max = t;      c[i] += update(clset, d, b+i, x+i);    }                           /* update the center coordinates */    /* -- update the (co)variances -- */    a = (type & CLS_SIZE)       /* compute the rescaling factor */      ? 1 : p->var /p->msd;     /* (if the cluster size is fixed) */    p->scl = 1/a;               /* and its reciprocal value */    if (type & (CLS_COVARS|CLS_VARS)) {      for (i = clset->incnt; --i >= 0; ) {        for (k = (type & CLS_COVARS) ? clset->incnt : i+1; --k >= i; ) {          v = mat_get(p->cov, i, k);    /* get the covariance matrix */          d = mat_get(p->smp, i, k) *a -v; /* element and its change */          t = mat_get(p->bfv, i, k);    /* and update its value with */          u = mat_get(p->chv, i, k);    /* possible add. parameters */          v += update(clset, d, &t, &u);          mat_set(p->cov, i, k, v);     /* set the new value of the */          mat_set(p->bfv, i, k, t);     /* covariance matrix element, */          mat_set(p->chv, i, k, u);     /* note the updated params. */        }                       /* (compute a new covariance matrix */      } }                       /*  or at least new variances) */    else if (type & CLS_SIZE) { /* -- if isotropic variance */      t = mat_get(p->bfv, 0,0); /* get the additional parameters */      u = mat_get(p->chv, 0,0); /* for the variance update */      p->var += update(clset, p->msd -p->var, &t, &u);      if (p->var < MINVAR) p->var = MINVAR;      if (p->var > MAXVAR) p->var = MAXVAR;      mat_set(p->bfv, 0, 0, t); /* update the isotropic variance, */      mat_set(p->chv, 0, 0, u); /* ensure that it is positive, */    }                           /* and note the updated parameters */    /* -- compute inverses and reinitialize -- */    if (type & CLS_COVARS) {    /* -- if adaptable covariances */      if (mat_chdecom(p->inv, p->cov) != 0) {        mat_copy(p->cov, p->smp, MAT_UPPER);        mat_chdecom(p->inv, p->cov);      }                         /* decompose new covariance matrix */      det = mat_chdet(p->inv);  /* compute the new determinant */      var = ((det >= MINDET) && (det <= MAXDET))          ? pow(det,            1.0/clset->incnt)          : exp(mat_chlogd(p->inv) /clset->incnt);      if (var < MINVAR) var = MINVAR;      if (var > MAXVAR) var = MAXVAR;      mat_chinv(p->inv,p->inv); /* invert the new covariance matrix */      if (type & CLS_SIZE)      /* if the cluster size is adaptable, */        p->var = var;           /* copy the new cluster size */      else {                    /* if the cluster size is fixed */        mat_trmuls(p->cov, p->cov, MAT_UPPER, p->var /var);        mat_trmuls(p->inv, p->inv, MAT_UPPER, var /p->var);      }                         /* scale to the fixed cluster size */      mat_tr2sym(p->cov, p->cov, MAT_UPPER);  /* complete the      */      mat_tr2sym(p->inv, p->inv, MAT_UPPER);  /* two matrices and  */      mat_init(p->smp, MAT_ZERO, NULL); }     /* reset aggregation */    else if (type & CLS_VARS) { /* -- if adaptable variances */      det = mat_diaprod(p->cov); /* compute the new determinant */      var = ((det >= MINDET) && (det <= MAXDET))          ? pow(det,            1.0/clset->incnt)          : exp(mat_dialog(p->smp) /clset->incnt);      if (var < MINVAR) var = MINVAR;      if (var > MAXVAR) var = MAXVAR;      if (type & CLS_SIZE) {    /* if the cluster size is adaptable, */        a = 1; p->var = var; }  /* copy the new cluster size */      else {                    /* otherwise (fixed cluster size) */        a = p->var /var; }      /* compute the rescaling factor */      for (i = clset->incnt; --i >= 0; ) {        t = fabs(s[i] -c[i]); if (t > max) max = t;        c[i] = s[i];            /* copy the new center coordinates */        t = mat_get(p->cov, i, i) *a;        if (t < MINVAR) t = MINVAR;        if (t > MAXVAR) t = MAXVAR;        mat_set(p->cov, i, i, t);        mat_set(p->inv, i, i, 1/t);    /* copy the variances and */      }                         /* compute the inverse variances */      mat_init(p->smp, MAT_RESET, NULL);      mat_diainit(p->smp, -1);} /* reset the aggregation matrix */    else {                      /* --- if isotropic variance */      if (type & CLS_SIZE) {    /* if the cluster size is adaptable, */        if (p->var < MINVAR) p->var = MINVAR;        if (p->var > MAXVAR) p->var = MAXVAR;        mat_diainit(p->smp,-1); /* reinitialize the variances */      }      mat_init(p->smp, MAT_RESET, NULL);    }                           /* reset the aggregation matrix */  }  return max;                   /* return the maximal change */}  /* _nnupd() */               /* of a center coordinate *//*----------------------------------------------------------------------  Main Functions----------------------------------------------------------------------*/void cls_init (CLSET *clset, int mode, double range,               double randfn(void), const double *vec){                               /* --- initialize a set of clusters */  int     i, k, n;              /* loop variables */  CLUSTER *p;                   /* to traverse the clusters */  NSTATS  *nst;                 /* simple numerical statistics */  double  *c, *b;               /* cluster center, buffer */  double  w, x, d, m;           /* cluster weight, buffers */  assert(clset && randfn);      /* check the function arguments */  /* --- initialize other parameters --- */  if (((mode & 0xf) != CLS_POINTS)    /* if not called second time */  ||  (clset->init <= 0) || (clset->init >= clset->clscnt)) {    w = 1.0 /clset->clscnt;     /* initial relative cluster weight */    for (p = clset->cls +(k = clset->clscnt); --k >= 0; ) {      (--p)->wgt = w;           /* traverse the clusters and */      p->var = p->scl = p->d2 = 1;   /* init. the parameters */      mat_init(p->cov, MAT_UNIT, NULL);      mat_init(p->inv, MAT_UNIT, NULL);      mat_init(p->smp, MAT_ZERO, NULL);    }                           /* initialize the matrices */  }                             /* for all clusters */  /* --- special initialization for centers at origin --- */  if (mode & CLS_ORIGIN) {      /* if to set centers to origin */    for (p = clset->cls +(k = clset->clscnt); --k >= 0; ) {      for (c = (--p)->ctr +(i = clset->incnt); --i >= 0; ) {        *--c = 0;               /* set all coordinates to zero */        mat_set(p->cov, i, i, x = 0.4 +0.8*randfn());        mat_set(p->inv, i, i, 1/x);      }                         /* initialize the diagonal of */    } return;                   /* the covariance matrix randomly */  }                             /* and set the inverse matrix */  /* --- initialize cluster centers --- */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩理论片网站| 久久久欧美精品sm网站| 色94色欧美sute亚洲线路一ni| 日韩女优av电影| 亚洲成av人在线观看| 91久久精品一区二区三| 亚洲精品视频在线观看网站| 久久99蜜桃精品| 欧美不卡一二三| 激情综合色综合久久| 精品福利在线导航| 国产自产视频一区二区三区| 欧美巨大另类极品videosbest | 国产欧美一区二区精品性色超碰 | 国产精品自在在线| 奇米色一区二区三区四区| 理论片日本一区| 极品少妇xxxx精品少妇偷拍| 天天色天天操综合| 日韩精品一卡二卡三卡四卡无卡| 亚洲三级电影网站| 蓝色福利精品导航| 国产成人综合在线播放| 日韩免费视频一区二区| 国产成人精品一区二| 精品国产一区二区三区四区四| 国产精品综合av一区二区国产馆| 精品成a人在线观看| 欧美视频三区在线播放| 欧美日韩国产在线观看| 在线成人免费视频| 日韩精品一区二区在线观看| 日韩国产一二三区| 蜜桃在线一区二区三区| 美女mm1313爽爽久久久蜜臀| 成人手机在线视频| 91免费国产在线| 91精品国产品国语在线不卡| 国产精品国产成人国产三级| 国产精品麻豆网站| 久久国产免费看| 精品精品国产高清a毛片牛牛| 国产欧美一区二区三区网站| 国产91露脸合集magnet| 国产成人午夜片在线观看高清观看| 国产一区二区三区四区五区美女 | av网站免费线看精品| 欧美日韩免费电影| 在线亚洲人成电影网站色www| 一区二区三区四区av| 欧美怡红院视频| 国产一区91精品张津瑜| 久久久91精品国产一区二区三区| 欧美中文字幕亚洲一区二区va在线 | 91女神在线视频| 另类调教123区| 亚洲综合在线观看视频| 久久久久久久久一| 欧美日韩国产天堂| 91在线无精精品入口| 激情综合网天天干| 天堂一区二区在线| 国产日韩亚洲欧美综合| 欧美性大战久久| 成人av综合在线| 久久se这里有精品| 午夜精品一区二区三区三上悠亚| 欧美成人午夜电影| 欧美日韩三级视频| 日本韩国一区二区三区| 成人免费视频一区二区| 国内精品自线一区二区三区视频| 亚洲成av人**亚洲成av**| 欧美韩国日本一区| 欧美日韩国产一区二区三区地区| av在线不卡免费看| 国产成人aaaa| 国产白丝网站精品污在线入口| 久久精品国产亚洲一区二区三区| 亚洲视频在线一区二区| 欧美韩国一区二区| 欧美一级xxx| 欧美一区二区三区成人| 欧美久久久久中文字幕| 欧美性生交片4| 欧美色成人综合| 精久久久久久久久久久| 亚洲成人av一区| 亚洲一区在线视频观看| 国产亚洲欧美日韩在线一区| 日韩精品一区二区三区在线播放 | 精品福利二区三区| 欧美一区二区三区白人| 欧美久久久久久久久久| 欧美日韩国产天堂| 欧美在线播放高清精品| 波波电影院一区二区三区| 国产成人亚洲精品青草天美| 国产成人精品一区二| 成人性生交大片免费看视频在线| 国产成人在线免费| 不卡的看片网站| 色综合视频一区二区三区高清| 91欧美一区二区| 91在线看国产| 欧美日韩精品一区二区三区| 久久99日本精品| 成人黄色一级视频| 国内外成人在线| 不卡一区二区三区四区| 91理论电影在线观看| 成人免费高清在线观看| 一区二区三区高清不卡| 精品成人私密视频| 日韩丝袜情趣美女图片| 欧美亚洲综合久久| 欧美性色欧美a在线播放| 国产91丝袜在线播放0| 国产一区二区视频在线| 4438x成人网最大色成网站| 白白色亚洲国产精品| 成人精品视频网站| 99久久精品久久久久久清纯| 国产精品夜夜嗨| 日本高清不卡视频| 欧美一二区视频| 亚洲主播在线观看| 久久国产生活片100| 国产91在线|亚洲| 99re在线精品| 欧美成人video| 午夜免费久久看| 日韩三级在线免费观看| 色视频成人在线观看免| 国产成人免费视频| 久久亚洲精品国产精品紫薇| 亚洲大片一区二区三区| 成人av在线影院| 欧美精品一区二区在线播放| 三级影片在线观看欧美日韩一区二区 | 日韩女优电影在线观看| 一区二区在线观看av| 亚洲嫩草精品久久| 成人一区二区三区视频在线观看| 欧美老肥妇做.爰bbww| 亚洲最大的成人av| 99久久久精品免费观看国产蜜| 国产蜜臀97一区二区三区 | 亚洲欧美一区二区三区极速播放| 久久99久久精品欧美| 欧美一区三区二区| 日韩在线观看一区二区| 制服丝袜中文字幕亚洲| 日本不卡视频一二三区| 欧美videos中文字幕| 国产在线精品一区二区三区不卡| 欧美成人免费网站| 成人永久免费视频| 亚洲色欲色欲www在线观看| 日本电影亚洲天堂一区| 亚洲国产人成综合网站| 国产亲近乱来精品视频| 麻豆视频观看网址久久| 久久久不卡网国产精品一区| eeuss鲁一区二区三区| 亚洲福利一区二区三区| 亚洲成人在线免费| 欧美tk—视频vk| 欧美日本一道本| 精品欧美乱码久久久久久| 91麻豆精品国产91久久久资源速度| 午夜不卡在线视频| 777奇米四色成人影色区| 国产一区二区三区电影在线观看| 亚洲精品中文字幕乱码三区| 国产亚洲精品资源在线26u| 亚洲欧美日韩系列| 丁香亚洲综合激情啪啪综合| 欧美精品电影在线播放| 久久噜噜亚洲综合| 丁香另类激情小说| 国产精品久久福利| 欧美专区在线观看一区| 午夜精品福利一区二区蜜股av| 欧美一区二区三区免费| 极品尤物av久久免费看| 国产精品你懂的在线| 91久久精品国产91性色tv| 亚洲风情在线资源站| 国产三级一区二区三区| 欧美精品自拍偷拍动漫精品| 色婷婷综合中文久久一本| 国内国产精品久久| 蜜臀av性久久久久蜜臀av麻豆 | 日韩欧美视频在线| av资源网一区| 91亚洲资源网| 欧美最猛黑人xxxxx猛交| 成人av先锋影音| 91麻豆免费观看|