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

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

?? cluster.c

?? 隱馬爾科夫模型工具箱
?? C
?? 第 1 頁 / 共 5 頁
字號:
               if (clCnt[curr_class][j])                  mlv[j] += ((double)clCnt[curr_class][j]) * log(clCnt[curr_class][j]);               if (clCnt[j][curr_class])                  mlv[j] += ((double)clCnt[j][curr_class]) * log(clCnt[j][curr_class]);            }         }      }      else {         if (logfile) {            if (verbose) {               fprintf(logfile, "...decided not to move word %d from class %d\n", w, curr_class);            }            else {               fprintf(logfile, "--\n");            }         }         fflush(stdout);      }      if (show_MLV && logfile) {         fprintf(logfile, "   MLV = %f\n", curr_MLV);      }#ifdef INTEGRITY_CHECK      /* Debug: Check our counts still sum correctly */      check_counts_sum();      /* Debug: Check our updated MLV counts */      max_likelihood_check();#endif   }   if (w_period) {      /* Make sure recovery file reflects end of iteration */      export_classes(1);      sprintf(tmp, "%.150s.recovery", export_prefix);      file = FOpen(tmp, NoOFilter, &pipe_status);      check_file(file, tmp, "do_one_iteration");      fprintf(file, "Clustering automatic recovery status file\n");      fprintf(file, "Clustered up to (excluding) word: all\n");      fprintf(file, "Clusters are stored in: %.150s.recovery.cm\n", export_prefix);      fprintf(file, "Keep unknown word token separate: %d\n", unk_sep?1:0);      fprintf(file, "Sort order: %s\n", (sort_order==SORT_WMAP)?"WMAP":"FREQ");      FClose(file, pipe_status);   }   if (total_warnings>=10) {      HError(-17053, "A total of %d words were found in the wordmap but not in the gram files", total_warnings);   }}/* Recover from a given recovery file */void do_recovery(char *fname, int words){   FILE *file;   char *ptr;   int   from;   Boolean pipe_status;      file = FOpen(fname, NoFilter, &pipe_status);   check_file(file, fname, "do_recovery");   fgets(tmp, 256, file);   if (strncmp(tmp, "Clustering automatic", 20)!=0) {      HError(17013, "This is not a recovery status file");   }   fgets(tmp, 256, file);   ptr = strchr(tmp, ':');   if (!ptr) {      HError(17013, "Failure to read current word point from status file");   }   ptr++;   ptr += strspn(ptr, " \t");   if (strncmp(ptr, "all", 3)==0) {      from = -1;   }   else {      from = atoi(ptr);   }   fgets(tmp, 256, file);   ptr = strchr(tmp, ':');   if (!ptr) {      HError(17013, "Failure to read recovery class map file name from status file");   }   ptr++;   ptr = strtok(ptr, " \t\n");   import_classmap(ptr, words);   fgets(tmp, 256, file);   ptr = strchr(tmp, ':');   if (!ptr) {      HError(17013, "Failure to read recovery unknown word status from status file");   }   ptr++;   ptr += strspn(ptr, " \t");   unk_sep = (*ptr=='1');   start_class = unk_sep?3:2;   fgets(tmp, 256, file);   ptr = strchr(tmp, ':');   if (!ptr) {      HError(17013, "Failure to read recovery word sort order status from status file");   }   ptr++;   ptr += strspn(ptr, " \t");   sort_order = (*ptr=='W')?SORT_WMAP:SORT_FREQ;   FClose(file, pipe_status);   if (trace & T_TOP) {      printf("Continuing from recovered state\n");   }   classes_init(words);   setup_all_counts();     if (trace & T_TOP) {      printf("Iterations that had been completed: %d\n", export_index);   }   export_index++;   /* Open output log file */   if (write_logfile) {      sprintf(tmp, "%.150s.%d.log", export_prefix, export_index);      logfile = FOpen(tmp, NoOFilter, &pipe_logfile);      check_file(logfile, tmp, "do_recovery");   }   else      logfile = NULL;   if (from>=0) {      do_one_iteration(rec_freq, from);   }   if (logfile)      FClose(logfile, pipe_logfile);   export_classes(0);   if (trace & T_EXTRA) {      printf("Completed iteration which started from recovered state\n");      if (from == -1) {         printf("   (no change since recovery state was stored at end of iteration)\n");      }   }}/* Initialise the values used when calculating the current value of the   maximum likelihood equation used when clustering */static void max_likelihood_init(void){   int i, j;   if (show_MLV)      curr_MLV=0;   /* We store all those values from the summation which involve a      particular class in a value specifically for that class */   for (i=0; i<N; i++) {      mlv[i] = 0;      for (j=0; j<N; j++) {         if (clCnt[i][j]) {            mlv[i] += ((double)clCnt[i][j]) * log(clCnt[i][j]);            if (show_MLV) {               curr_MLV += ((double)clCnt[i][j]) * log(clCnt[i][j]);            }         }         if (i!=j) {            if (clCnt[j][i])               mlv[i] += ((double)clCnt[j][i]) * log(clCnt[j][i]);         }      }      if (clSum[i]) {         mlv[i] -= 2*(((double)clSum[i]) * log(clSum[i]));         if (show_MLV) {            curr_MLV -= 2*(((double)clSum[i]) * log(clSum[i]));         }      }   }}#ifdef INTEGRITY_CHECK/* Check the contents of the maximum likelihood running totals store */static void max_likelihood_check(void){   int i, j;   double a;   char s1[50], s2[50];  /* We store all those values from the summation which involve a     particular class in a value specifically for that class */   for (i=0; i<N; i++) {      a = 0;      for (j=0; j<N; j++) {         if (clCnt[i][j])            a += ((double)clCnt[i][j]) * log(clCnt[i][j]);         if (i!=j) {            if (clCnt[j][i])               a += ((double)clCnt[j][i]) * log(clCnt[j][i]);         }      }      if (clSum[i])         a -= 2*(((double)clSum[i]) * log(clSum[i]));      /* Compare strings, to ignore minor precision differences */      sprintf(s1, "%f", a);      sprintf(s2, "%f", mlv[i]);      if (strcmp(s1, s2)) {         HError(17097, "max_likelihood_check: MLV for class %d is wrong - %f instead of %f", i, mlv[i], a);      }   }}#endif/* Perform a given number of iterations of the clustering algorithm */void cluster_words(int iterations){   int i;   for (i=0; i<iterations; i++) {      /* Also keep a separate iteration count - we do this because it's         possible to call cluster_words() multiple times from a host         program, or to continue from an existing classmap */      export_index++;            if (trace & T_TOP) {         printf("Beginning iteration %d\n", export_index);      }            /* Open output log file */      if (write_logfile) {         sprintf(tmp, "%.150s.%d.log", export_prefix, export_index);         logfile = FOpen(tmp, NoOFilter, &pipe_logfile);         check_file(logfile, tmp, "cluster_words");      }      do_one_iteration(rec_freq, 0);      if (logfile)         FClose(logfile, pipe_logfile);      if (trace & T_TOP) {         printf("Iteration complete\n");      }   }}/* Setup all class counts, given existing class word map */void setup_all_counts(void){   register int i, j;   for (i=0; i<N; i++) {      clSum[i] = 0;      for (j=0; j<N; j++) {         clCnt[i][j] = 0;      }   }   for (i=0; i<W; i++) {      /* Class unigram counts */      clSum[clMemb[i]] += uni[i];      /* Class bigram counts */      for (j=0; j<forward[i].size; j++) {         clCnt[clMemb[i]][clMemb[forward[i].bi[j].id]] += forward[i].bi[j].count;      }   }   /* Now initialise the maximisation function class values */   max_likelihood_init();}/* Perform some initial clustering - currently just puts all in one class */void initial_cluster(void){   register int i;   for (i=0; i<W; i++) {      if (unk_sep) {         clMemb[i] = 3;     /* Put everything in class 3 */      }      else {         clMemb[i] = 2;     /* Put everything in class 2 */      }   }   clMemb[start_id] = 0;   clMemb[end_id] = 1;   if (unk_sep) {      clMemb[unk_id] = 2;   }   /* Note that external class numbers are all +1 relative to internal (HLM can't cope      with class 0 in a class map) */   if (trace & T_EXTRA) {      printf("Initial clustering performed: all words in class %d (total count=%d)\n", unk_sep?4:3, sum_of_all_bigram_counts);      printf ("   (sentence start in class 1; sentence end in class 2%s)\n", unk_sep?"; unknown in class 3":"");   }}/* Define sorting order of words alphabetically, given id */int id_sort(UInt *in1, UInt *in2){   return strcmp(what_is_word(*in1), what_is_word(*in2));}/* Write out a HLM class map file (pass non-zero to write recovery file) */void export_classes(int recovery){   FILE *out;   int   i, j, index;   Boolean pipe_status;   /* %.150s limits the length of the filename prefix to 150 characters */   if (recovery) {      sprintf(tmp, "%.150s.recovery.cm", export_prefix);   }   else {      sprintf(tmp, "%.150s.%d.cm", export_prefix, export_index);   }   out = FOpen(tmp, LCMapOFilter, &pipe_status);   check_file(out, tmp, "export_classes");   /* Write header */   if (recovery) {      fprintf(out, "Name=Classmap_%s_iteration%d\n", export_prefix, export_index-1);      fprintf(out, "Entries=%d\n", N);      fprintf(out, "Iterations=%d\n", export_index-1);   }   else {      fprintf(out, "Name=Classmap_%s_iteration%d\n", export_prefix, export_index);      fprintf(out, "Entries=%d\n", N);      fprintf(out, "Iterations=%d\n", export_index);   }   if (outCMapRaw) {      fprintf(out, "EscMode=Raw\n");   }   else {      fprintf(out, "EscMode=HTK\n");   }   fprintf(out, "\\Classes\\\n");   for (i=0; i<N; i++) {      index = 0;      for (j=0; j<W; j++) {         if (clMemb[j] == i) {            class_sort[index] = j;            index++;         }      }      qsort(class_sort, index, sizeof(UInt),            (int (*) (const void *, const void *)) &id_sort);      fprintf(out, "CLASS%d %d %d IN\n", i+1, i+1, index);      if (outCMapRaw) {         for (j=0; j<index; j++) {            fprintf(out, " %s\n", what_is_word(class_sort[j]));         }      }      else {         for (j=0; j<index; j++) {            fprintf(out, " %s\n", ReWriteString(what_is_word(class_sort[j]), NULL, ESCAPE_CHAR));         }      }   }   FClose(out, pipe_status);}#ifdef INTEGRITY_CHECK/* Debugging: Do integrity check on counts - ensure they sum   to the same value after each loop! */void check_counts_sum(void){   register int i, j;   register int a, b;   a = 0;   b = 0;   for (i=0; i<N; i++) {      a += clSum[i];      for (j=0; j<N; j++) {         b += clCnt[i][j];      }   }   if (a != sum_of_all_uni_counts) {      HError(17096, "check_counts_sum: unigrams now sum to %d, not %d", a, sum_of_all_uni_counts);   }   if (b != sum_of_all_bigram_counts) {      HError(17096, "check_counts_sum: bigrams now sum to %d, not %d", a, sum_of_all_bigram_counts);   }   if (a != b) {      HError(17096, "check_counts_sum: uni and bi totals differ - %d v %d", a, b);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美私模裸体表演在线观看| 蜜臀国产一区二区三区在线播放| 美女久久久精品| 欧美日韩不卡视频| 无码av免费一区二区三区试看 | 国产电影一区在线| 欧美精品一区二区久久久| 国模少妇一区二区三区| 久久精品男人天堂av| 成人中文字幕在线| 亚洲视频一区二区在线观看| 欧美在线观看视频一区二区| 亚洲国产综合人成综合网站| 日韩一区二区视频| 国产精品一二三四五| 中文字幕中文字幕一区| 欧美在线不卡视频| 蜜臀a∨国产成人精品| 日韩欧美成人激情| 99免费精品视频| 一区二区三区四区中文字幕| 欧美一级欧美一级在线播放| 国产成人精品综合在线观看| 一区二区三区在线视频观看 | 亚洲欧美电影一区二区| 欧美亚洲动漫另类| 国内精品国产成人| 亚洲人成精品久久久久久| 欧美一区二区三区四区五区| 国产成人鲁色资源国产91色综 | 精品国产露脸精彩对白| 91日韩一区二区三区| 天天色天天爱天天射综合| 亚洲国产精品99久久久久久久久| 色美美综合视频| 狠狠v欧美v日韩v亚洲ⅴ| 亚洲欧美乱综合| 久久美女高清视频| 欧美日韩在线播| 丁香婷婷综合色啪| 奇米影视在线99精品| 亚洲精品国产高清久久伦理二区| 91精品国产91久久久久久一区二区| 成人黄色软件下载| 久久99在线观看| 亚洲午夜久久久久久久久电影网 | 91精品免费观看| 成人午夜视频免费看| 日韩激情视频在线观看| 亚洲精品久久久久久国产精华液| 亚洲精品一区二区三区香蕉| 在线欧美日韩精品| 波多野洁衣一区| 激情综合网激情| 天天做天天摸天天爽国产一区| 国产精品久久久久影院老司| 亚洲精品在线免费观看视频| 717成人午夜免费福利电影| 色妞www精品视频| av成人动漫在线观看| 国产在线播放一区三区四| 久久精品国产第一区二区三区| 亚洲一区二区中文在线| 亚洲乱码中文字幕| 国产精品成人在线观看| 国产精品拍天天在线| 欧美精品一区二| 精品国产一区二区精华| 欧美一区二区黄色| 欧美一区二区三区在线看| 欧美日本不卡视频| 欧美日韩大陆在线| 欧美在线免费观看视频| 91福利视频在线| 在线观看欧美黄色| 欧洲色大大久久| 91国产免费看| 欧美亚洲国产一区二区三区va| 欧美午夜视频网站| 911精品产国品一二三产区| 精品视频免费看| 欧美少妇一区二区| 欧美日韩日日夜夜| 制服丝袜一区二区三区| 欧美一区二区黄| 久久久久久久久蜜桃| 久久久久久久久久美女| 国产精品色噜噜| 中文字幕欧美一| 亚洲一区二区三区四区在线观看 | 日韩一区二区三区免费看| 欧美美女黄视频| 日韩一区二区在线看| 欧美成人一区二区| 国产女人18水真多18精品一级做| 国产网红主播福利一区二区| 国产精品欧美一区二区三区| 最新日韩在线视频| 婷婷一区二区三区| 久久综合综合久久综合| 国产在线精品免费| 99久久综合精品| 欧美日韩性生活| 欧美精品一区二区三区久久久| 国产欧美精品区一区二区三区 | 亚洲一区二区三区四区的| 日韩精品91亚洲二区在线观看| 国产真实乱子伦精品视频| 白白色亚洲国产精品| 欧美日韩在线精品一区二区三区激情 | 精品国产凹凸成av人导航| 国产精品色一区二区三区| 一区二区三区精品视频在线| 日本va欧美va瓶| 国产乱码精品一区二区三区五月婷| 国产成人在线视频网址| 欧美图片一区二区三区| 精品乱人伦小说| 亚洲色图欧美激情| 久久精品国产77777蜜臀| www.日韩大片| 欧美精品一二三| 国产精品国产三级国产普通话三级 | 国产亚洲成年网址在线观看| 亚洲精品少妇30p| 激情图片小说一区| 91国产成人在线| 亚洲国产精品精华液ab| 日韩激情av在线| 91麻豆视频网站| 精品国精品自拍自在线| 一区二区三区中文字幕| 国产成人精品三级| 欧美一区二区三区视频免费播放| 国产精品美女久久久久久久久| 午夜精品久久久久| 91一区二区在线观看| 精品国产乱码久久久久久图片| 亚洲一二三四区| 不卡视频一二三四| 亚洲精品一区二区三区精华液| 亚洲午夜视频在线| 色综合久久中文字幕| 国产亚洲精品福利| 久久成人综合网| 91精品国产综合久久香蕉的特点| 亚洲视频 欧洲视频| 国产成人在线色| 久久综合久久综合久久| 美女视频黄频大全不卡视频在线播放| 色哟哟在线观看一区二区三区| 国产亚洲自拍一区| 激情五月播播久久久精品| 日韩亚洲欧美在线观看| 婷婷丁香激情综合| 欧美日韩国产综合一区二区三区| 一区二区三区丝袜| 99国内精品久久| 国产精品久久久久久久久免费丝袜| 精彩视频一区二区三区| 日韩免费电影一区| 卡一卡二国产精品| 欧美va亚洲va香蕉在线| 美女被吸乳得到大胸91| 日韩欧美国产午夜精品| 丝袜美腿成人在线| 91麻豆精品国产91久久久久久久久| 一卡二卡三卡日韩欧美| 91福利在线导航| 亚洲国产精品一区二区尤物区| 色呦呦网站一区| 亚洲国产一区视频| 欧美日韩一级二级| 麻豆一区二区99久久久久| 日韩欧美综合一区| 久久国产成人午夜av影院| 精品国产乱码久久久久久牛牛| 久久精品国内一区二区三区| 精品国产污污免费网站入口 | 亚洲午夜久久久久久久久电影网| 91久久精品一区二区二区| 一区二区三区色| 9191国产精品| 国产精品资源网| 综合激情成人伊人| 亚洲色图在线播放| 亚洲精品日产精品乱码不卡| 美女精品一区二区| 日韩你懂的在线观看| 精彩视频一区二区三区| 久久精品日产第一区二区三区高清版| 国产精品自拍一区| 亚洲乱码中文字幕| 8v天堂国产在线一区二区| 韩国成人福利片在线播放| 日本一区二区综合亚洲| 欧美性色黄大片| 国产自产高清不卡| 亚洲精品一卡二卡| 精品国产一区二区三区久久影院|