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

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

?? cluster2.c

?? 聚類算法全集以及內附數據集
?? C
?? 第 1 頁 / 共 4 頁
字號:
/*----------------------------------------------------------------------  File    : cluster2.c  Contents: cluster and cluster set management (update functions)  Author  : Christian Borgelt  History : 05.09.2001 file created as cluster1.c            12.09.2001 function cls_init completed            15.09.2001 first version of fuzzy c-means completed            16.09.2001 hard c-means algorithm added (msexp <= 0)            09.09.2002 neural network update methods added            29.01.2003 some cleanup of neural network methods            31.01.2003 initialization for resilient method changed            18.02.2003 multiple init. in mode CLS_POINTS removed            07.06.2003 cluster size adaptation added            29.10.2003 bug in function cls_init fixed (CLS_POINTS)            22.02.2004 size computation for spherical clusters modified            23.02.2004 bug in function _quick fixed            29.02.2004 some bugs in cluster size computation fixed            01.03.2004 update functions moved to this file            02.03.2004 shape and size regularization added            19.03.2004 weight/prior regularization added            12.04.2004 competitive learning function completed            13.04.2004 regularization adapted for competitive learning            14.04.2004 treatment of (almost) empty clusters improved            15.04.2004 update function improved (loop moved)            23.04.2004 some numeric problems with high-dim. data solved            26.04.2004 more numeric problems with high-dim. data solved            27.04.2004 upper learning rate bound added (alt. est. step)            30.04.2004 rescaling removed from parameter est. functions            13.07.2004 normalization of center vectors added            15.07.2004 bug in center normalization for _complrn fixed            28.07.2004 update of centers only added to cls_update            14.08.2004 bug in initialization with CLS_POINTS fixed            18.08.2004 first version of backpropagation functions added----------------------------------------------------------------------*/#include <stdlib.h>#include <float.h>#include <math.h>#include <assert.h>#include "cluster.h"/*----------------------------------------------------------------------  Preprocessor Definitions----------------------------------------------------------------------*/#define MINVAR       1e-12      /* minimal variance */#define MAXVAR       1e+12      /* maximal variance */#define MINDET       1e-48      /* minimal determinant */#define MAXDET       1e+48      /* maximal determinant */#define MINWEIGHT    1e-6       /* minimal cluster weight *//*----------------------------------------------------------------------  Type Definitions----------------------------------------------------------------------*/typedef MATRIX* MATADDFN (MATRIX *mat, const double *vec, double wgt);typedef double  UPDATEFN (CLSET* clset, double grd, double *prv,                          double *chg);/*----------------------------------------------------------------------  Auxiliary Functions----------------------------------------------------------------------*/static double _decom (CLUSTER *p){                               /* --- decompose covariance matrix */  int    i;                     /* loop variables */  double t;                     /* buffer fro shift value */  for (t = MINVAR, i = 40; --i >= 0; t += t) {    if (mat_chdecom(p->inv, p->smp) == 0) break;    mat_diaadds(p->smp, t);     /* decompose the covariance matrix */  }                             /* and on failure shift eigenvalues */  if (i < 0) {                  /* if decomposition fails totally */    mat_init(p->smp, MAT_UNIT|MAT_NOTBUF, NULL);    mat_init(p->inv, MAT_UNIT|MAT_NOTBUF, NULL);  }                             /* set a unit covariance matrix */  return mat_chdet(p->inv);     /* return the determinant */}  /* _decom() *//*--------------------------------------------------------------------*/static void _normctr (CLSET *clset, int sum){                               /* --- normalize center vectors */  int     i, k;                 /* loop variables */  CLUSTER *p;                   /* to traverse the clusters */  double  *c;                   /* to traverse the center vector */  double  len;                  /* length of a center vector */    assert(clset);                /* check the function argument */  for (p = clset->cls +(i = clset->clscnt); --i >= 0; ) {    if ((--p)->d2 < 0) continue;/* traverse marked clusters */    c = (sum) ? p->sum : p->ctr;/* get the vector to normalize */    len = 0;                    /* initialize the length */    for (c += k = clset->incnt; --k >= 0; ) {      --c; len += *c * *c; }    /* sum the squared coordinates */    len = sqrt(len);            /* compute the vector length */    len = (len > 0)             /* and the normalization factor */        ? (sum ? mat_weight(p->smp) : 1.0) /len : 1;    if (fabs(1.0 -len) < 1e-12) continue;    for (c += k = clset->incnt; --k >= 0; )      *--c *= len;              /* normalize the center vectors */  }                             /* to unit length */}  /* _normctr() *//*--------------------------------------------------------------------*/static void _zeroctr (CLSET *clset, int sum){                               /* --- set center vectors to origin */  int     i, k;                 /* loop variables */  CLUSTER *p;                   /* to traverse the clusters */  double  *c;                   /* to traverse the center vector */  assert(clset);                /* check the function argument */  for (p = clset->cls +(i = clset->clscnt); --i >= 0; ) {    if ((--p)->d2 < 0) continue;/* traverse marked clusters */    c = (sum) ? p->sum : p->ctr;/* get the vector to zero */    for (c += k = clset->incnt; --k >= 0; )      *--c = 0;                 /* set all coordinates to zero */  }                             /* (move vector to origin) */}  /* _zeroctr() *//*----------------------------------------------------------------------  Gradient Function----------------------------------------------------------------------*/static void _gradient (CLSET *clset){                               /* --- gradient based update */  /* ... to be done ... */}  /* _gradient() *//*----------------------------------------------------------------------  Alternating Optimization Function----------------------------------------------------------------------*/static void _altopt (CLSET *clset){                               /* --- alternating optimization */  int     n;                    /* loop variable */  int     type;                 /* cluster type flags */  CLUSTER *p;                   /* to traverse the clusters */  double  det;                  /* determinant of covariance matrix */  assert(clset);                /* check the function argument */  if (clset->method & CLS_ORIGIN)  /* if cluster centers at origin, */    _zeroctr(clset, 1);            /* zero the center vectors */  if (clset->method & CLS_UNIT)    /* if centers on unit sphere, */    _normctr(clset, 1);            /* normalize the center vectors */  type = clset->type;           /* get the cluster type flags */  for (p = clset->cls +(n = clset->clscnt); --n >= 0; ) {    (--p)->nw *= clset->msd[1]; /* normalize cluster weights to sum 1 */    if (p->d2 < 0) continue;    /* skip clusters not to be updated */    if (type & CLS_COVARS) {    /* -- if adaptable covariances */      mat_covar(p->smp, p->smp, 1); /* compute new covariances */      det    = _decom(p);           /* and decompose the matrix */      p->msd = ((det >= MINDET) && (det <= MAXDET))             ? pow(det,            1.0/clset->incnt)             : exp(mat_chlogd(p->inv) /clset->incnt); }    else if (type & CLS_VARS) { /* -- if adaptable variances */      mat_var(p->smp, p->smp, 1);   /* compute new variances */      det    = mat_diaprod(p->smp); /* and the new determinant */      p->msd = ((det >= MINDET) && (det <= MAXDET))             ? pow(det,            1.0/clset->incnt)             : exp(mat_dialog(p->smp) /clset->incnt); }    else if (type & CLS_SIZE)   /* -- if adaptable isotropic variance */      p->msd = mat_isovar(p->sum, p->smp, 1);    else {                      /* -- if fixed isotropic variance */      mat_mean(p->sum, p->smp); /* compute only the mean values */      p->msd = p->var;          /* (i.e. a new cluster center) */    }                           /* copy the old isotropic variance */    if      (p->msd < MINVAR) p->msd = MINVAR;    else if (p->msd > MAXVAR) p->msd = MAXVAR;  }                             /* clamp the variance */}  /* _altopt() *//*----------------------------------------------------------------------  Competitive Learning Function----------------------------------------------------------------------*/static void _complrn (CLSET *clset){                               /* --- competitive learning */  int     i, n;                 /* loop variables */  int     type;                 /* cluster type flags */  CLUSTER *p;                   /* to traverse the clusters */  double  *s, *c;               /* to access the vectors */  double  lrc, lrv = 0, lrw = 0;/* learning rates */  double  eta, dec;             /* learning rate derivates */  double  t, d;                 /* temporary buffers */  assert(clset);                /* check the function argument */  /* --- compute learning rates --- */  t   = clset->decays[0];       /* get the decay parameter and */  lrc = clset->lrates[0];       /* compute the next learning rate */  if ((t > 0) && (t < 1)) lrc *= pow(t, clset->steps);  else if        (t < 0)  lrc *= pow(clset->steps+1, t);  type = clset->type;           /* get the cluster type flags */  if (type & (CLS_COVARS|CLS_VARS|CLS_SIZE)) {    t   = clset->decays[1];     /* get the decay parameter and */    lrv = clset->lrates[1];     /* compute the next learning rate */    if ((t > 0) && (t < 1)) lrv *= pow(t, clset->steps);    else if        (t < 0)  lrv *= pow(clset->steps+1, t);  }                             /* (learning rate for (co)variances) */  if (type & CLS_WEIGHT) {      /* if adaptable weights */    t   = clset->decays[2];     /* get the decay parameter and */    lrw = clset->lrates[2];     /* compute the next learning rate */    if ((t > 0) && (t < 1)) lrw *= pow(t, clset->steps);    else if        (t < 0)  lrw *= pow(clset->steps+1, t);  }                             /* (learning rate for weights) */  clset->steps++;               /* count the update step */  /* --- compute new parameters --- */  for (p = clset->cls +(n = clset->clscnt); --n >= 0; ) {    (--p)->nw *= clset->msd[1]; /* normalize cluster weights to sum 1 */    if (type & CLS_WEIGHT)      /* and compute new cluster weights */      p->nw = (1 -lrw) *p->wgt +lrw *p->nw;    if (p->d2 < 0) continue;    /* skip clusters not to be updated */    t = mat_weight(p->smp);     /* get the aggregation weight and */    eta = (t < 1) ? lrc : lrc/t;/* compute the learning rate and */    s = p->sum; c = p->ctr;     /* get aggregation vector and center */    for (i = clset->incnt; --i >= 0; )      s[i] = c[i] +eta *s[i];   /* compute new center coordinates */    /* Here p->sum is the aggregate of the difference vectors to the */    /* cluster centers and *not* the aggregate of the data vectors   */    /* as for alternating estimation/fuzzy clustering. Hence there   */    /* is no decay factor for the old cluster center p->ctr.         */    if (t < 1) { eta = lrv;   dec = 1 -lrv*t; }    else       { eta = lrv/t; dec = 1 -lrv;   }    dec *= p->scl;              /* compute learning rate and compl. */    if (type & CLS_COVARS) {    /* -- if adaptable covariances */      mat_trmuls(p->smp, p->smp, MAT_UPPER, eta);      if (dec > 0) mat_addx(p->smp, p->smp, dec, p->cov, MAT_UPPER);      d      = _decom(p);       /* update the covariance matrix */      p->msd = ((d >= MINDET) && (d <= MAXDET))             ? pow(d,              1.0/clset->incnt)             : exp(mat_chlogd(p->inv) /clset->incnt); }    else if (type & CLS_VARS) { /* -- if adaptable variances */      for (d = 1, i = clset->incnt; --i >= 0; ) {        t = ((dec > 0) ? dec *mat_get(p->cov, i, i) : 0)                       + eta *mat_get(p->smp, i, i);        if      (t < MINVAR) t = MINVAR;        else if (t > MAXVAR) t = MAXVAR;        d *= mat_set(p->smp, i, i, t);      }                         /* update the covariance matrix */      p->msd = ((d >= MINDET) && (d <= MAXDET))             ? pow(d,              1.0/clset->incnt)             : exp(mat_dialog(p->smp) /clset->incnt); }    else if (type & CLS_SIZE) { /* -- if adaptable isotropic var. */      d = mat_diaprod(p->smp);  /* update the isotropic variance */      t = ((d >= MINDET) && (d <= MAXDET))        ? pow(d,              1.0/clset->incnt)        : exp(mat_dialog(p->smp) /clset->incnt);      p->msd = ((dec > 0) ? dec *p->var : 0) +eta *t; }    else p->msd = p->var;       /* copy the isotropic variance */    if      (p->msd < MINVAR) p->msd = MINVAR;    else if (p->msd > MAXVAR) p->msd = MAXVAR;  }                             /* clamp the variance */  if (clset->method & CLS_ORIGIN)  /* if cluster centers at origin, */    _zeroctr(clset, 1);            /* zero the center vectors */  if (clset->method & CLS_UNIT)    /* if centers on unit sphere, */    _normctr(clset, 1);            /* normalize the center vectors */}  /* _complrn() *//*----------------------------------------------------------------------  Error Backpropagation Function----------------------------------------------------------------------*/static void _backprop (CLSET *clset){                               /* --- error backpropagation */  int     i, n;                 /* loop variables */  int     type;                 /* cluster type flags */  CLUSTER *p;                   /* to traverse the clusters */  double  *s, *c;               /* to access the vectors */  double  lrc, lrv, d, t;       /* learning rates, buffers */

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
蜜臀av性久久久久蜜臀aⅴ四虎| 美女视频免费一区| 欧美怡红院视频| 久草这里只有精品视频| 日本一区二区三区久久久久久久久不 | 亚洲成年人影院| 欧美国产1区2区| 欧美性欧美巨大黑白大战| 国产一区二区不卡| 日本在线不卡视频| 亚洲卡通欧美制服中文| 久久午夜国产精品| 欧美精品vⅰdeose4hd| 91免费看`日韩一区二区| 蜜臀av性久久久久蜜臀aⅴ四虎 | 555www色欧美视频| 99久久99久久精品免费看蜜桃| 日本色综合中文字幕| 一区二区理论电影在线观看| 国产欧美一区二区三区鸳鸯浴| 8x福利精品第一导航| 色诱亚洲精品久久久久久| 国产白丝网站精品污在线入口| 视频在线观看一区二区三区| 亚洲日穴在线视频| 中文字幕一区不卡| 欧美激情在线一区二区三区| 精品国产91洋老外米糕| 欧美精品aⅴ在线视频| 欧美日韩中文一区| 91久久国产综合久久| 99久久精品免费看国产免费软件| 国产精品影音先锋| 久久99精品国产麻豆婷婷| 一区二区三区资源| 亚洲天堂网中文字| 国产精品美女一区二区在线观看| 久久久亚洲午夜电影| 欧美精品一区二区三| 日韩一区二区免费在线观看| 欧美精品自拍偷拍| 欧美日韩成人一区二区| 欧美在线视频日韩| 欧美日韩一本到| 欧美三级中文字| 欧美日韩亚州综合| 欧美蜜桃一区二区三区| 欧美日韩成人在线| 日韩视频在线观看一区二区| 制服丝袜在线91| 精品奇米国产一区二区三区| 精品国产凹凸成av人网站| 久久亚洲二区三区| 国产欧美日韩另类一区| 国产精品乱码人人做人人爱| 中国色在线观看另类| 自拍偷拍亚洲激情| 一区二区三区欧美亚洲| 亚洲18女电影在线观看| 日韩—二三区免费观看av| 美女视频黄a大片欧美| 久久成人麻豆午夜电影| 国产**成人网毛片九色| zzijzzij亚洲日本少妇熟睡| 色综合欧美在线视频区| 欧美色老头old∨ideo| 日韩欧美一区二区在线视频| 亚洲精品在线免费观看视频| 欧美高清在线视频| 亚洲自拍偷拍综合| 麻豆精品一二三| 成人免费视频播放| 在线视频综合导航| 日韩欧美久久久| 国产精品久久久久婷婷| 亚洲午夜久久久久| 国内精品免费**视频| 菠萝蜜视频在线观看一区| 欧美在线制服丝袜| 欧美精品一区二区三区蜜臀| 国产精品超碰97尤物18| 亚洲电影一区二区| 国产精品一区三区| 欧美在线观看视频在线| 日韩免费在线观看| 中文字幕一区二区三区精华液| 亚洲午夜久久久久中文字幕久| 国内精品国产成人国产三级粉色| 91在线视频免费观看| 日韩欧美一卡二卡| 亚洲激情校园春色| 国内精品在线播放| 欧美日韩情趣电影| 国产亚洲综合在线| 日本不卡一二三| 一本久久a久久免费精品不卡| 777a∨成人精品桃花网| 国产精品久久99| 老司机精品视频一区二区三区| 一本一本久久a久久精品综合麻豆 一本一道波多野结衣一区二区 | 欧美一级精品大片| 亚洲女爱视频在线| 国产呦精品一区二区三区网站| 欧美吞精做爰啪啪高潮| 国产人妖乱国产精品人妖| 日日夜夜一区二区| 色综合久久66| 久久久噜噜噜久久中文字幕色伊伊| 亚洲国产精品久久久久秋霞影院| 福利电影一区二区| 91精品国产综合久久久久久漫画 | 精品国精品自拍自在线| 亚洲一区二区三区视频在线播放| 国产一区二区调教| 欧美一区二区三级| 夜夜精品浪潮av一区二区三区| 国产福利精品一区二区| 欧美一区二区三区视频在线| 樱花草国产18久久久久| 国产成人午夜精品影院观看视频 | 久久综合九色综合久久久精品综合| 一区二区三区.www| 99精品1区2区| 国产精品久久久久桃色tv| 国产精品亚洲成人| 久久久精品2019中文字幕之3| 麻豆精品国产传媒mv男同| 日本韩国精品在线| 国产精品久久久久久久久果冻传媒 | 中文字幕中文在线不卡住| 国产二区国产一区在线观看| 欧美成人在线直播| 麻豆免费看一区二区三区| 欧美日韩在线不卡| 天堂午夜影视日韩欧美一区二区| 91国产视频在线观看| 亚洲一区二区3| 在线观看成人小视频| 一区二区三区欧美日| 欧美综合一区二区| 一区二区三区 在线观看视频| 91网站最新地址| 亚洲精品成人在线| 欧美伊人久久久久久久久影院| 亚洲一区成人在线| 欧美剧情电影在线观看完整版免费励志电影| 日韩精品成人一区二区在线| 欧美日韩成人综合天天影院| 午夜国产不卡在线观看视频| 欧美高清性hdvideosex| 婷婷综合另类小说色区| 日韩一区二区三区四区| 捆绑紧缚一区二区三区视频| 日韩一级完整毛片| 国产精品1区2区| 日韩一区欧美一区| 色八戒一区二区三区| 亚洲国产精品影院| 欧美大片免费久久精品三p | 国产风韵犹存在线视精品| 国产精品视频一二| 色婷婷久久久亚洲一区二区三区 | 中文字幕视频一区| 欧美性xxxxxxxx| 麻豆精品视频在线| 中文一区在线播放| 欧美午夜寂寞影院| 久久国产夜色精品鲁鲁99| 久久网站最新地址| 99久久综合99久久综合网站| 亚洲高清不卡在线观看| 欧美一区二区三区思思人| 国产成人亚洲综合a∨婷婷图片| 国产精品久久久久久久久免费丝袜 | 欧美午夜一区二区三区| 麻豆成人久久精品二区三区红 | 美女视频黄频大全不卡视频在线播放 | 欧美电影在线免费观看| 国产在线一区二区综合免费视频| 国产精品久久久久一区| 制服丝袜一区二区三区| 成人久久18免费网站麻豆| 天天综合色天天| 日本一区二区成人| 欧美午夜片在线看| 一区二区三区四区在线播放| 5月丁香婷婷综合| a级精品国产片在线观看| 亚洲夂夂婷婷色拍ww47| 91精品国产欧美日韩| 国产精品资源网| 午夜久久久久久| 国产欧美日韩视频一区二区| 色久综合一二码| 粉嫩av亚洲一区二区图片| 亚洲美女屁股眼交3| 精品国产一区二区亚洲人成毛片| 色老头久久综合| 国产精品中文字幕欧美| 亚洲一区二区三区影院|