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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ginitest.cpp

?? 也是一個(gè)不錯(cuò)的SVM實(shí)現(xiàn)算法。經(jīng)常有人要用的
?? CPP
字號(hào):
/*****************************************************************************/// NAME  :        svmtest.cpp// // DESCRIPTION :  A sample svmtest file that demonstrate the usage of//                GINI SVM interface./////*****************************************************************************/#define _GINI_COUT_PRESENT_#define _HMMSVM_DEBUGON_#include<ginisvm.h>#include<stdio.h>#include<math.h>#include<string.h>#include<stdlib.h>//---------------------------------------------------------------------------// Print the Help for this code.//---------------------------------------------------------------------------void PrintHelp(){   printf("#------------------------------------------------------------------#\n");   printf("#         GINISVM VERSION 1.2                                      #\n");   printf("#   ( Center for Language and Speech Processing,JHU )              #\n");    printf("#------------------------------------------------------------------#\n");   printf("#------------------------------------------------------------------#\n");   printf("# Usage: ginitest [cmdline] <inputfile> <configfile> <outfile>     #\n");   printf("#                                                                  #\n");   printf("# Command Line arguments :                                         #\n");   printf("# -k <ktype>     0 -> Polynomial Kernel (a+b(x.y))^c               #\n");   printf("#                1 -> Gaussian Kernel  exp(-a ||x-y||^2)           #\n");   printf("#                2 -> DTK string kernel exp(-a*Leven(x,y))         #\n");   printf("#                                    ( b -> ins/del  penalty )     #\n");   printf("#                                    ( c -> same ins  penalty )    #\n");   printf("#                                    ( d -> subst  penalty )       #\n");   printf("#                3 -> Tanh Kernel  tanh(a(x.y))                    #\n");   printf("# -sp            sparse data format ( default: non-sparse )        #\n");   printf("# -cflag         Flag to indicate weights in training file         #\n");   printf("# -label         Flag to indicate labels are present in file       #\n");   printf("#------------------------------------------------------------------#\n");   printf("# <inputfile>   Input training file                                #\n");   printf("# <configfile> File where training parameters are stored           #\n");   printf("# <outfile>   File where probabilities are stored                  #\n");   printf("#------------------------------------------------------------------#\n");   printf("# Sample Usage :                                                   #\n");   printf("# ginitest -k 0 test.dat train.cfg test.out                        #\n");   printf("#------------------------------------------------------------------#\n");   printf("# Bug Reports: shantanu@jhu.edu                                    #\n");   printf("#------------------------------------------------------------------#\n");}// -------------------------------------------------------------------------//   Main Routine.// -------------------------------------------------------------------------int main(int argc, char** argv){   GINISVMKernelType ktype = GINISVMPOLY;   GINI_double p1 = 0;   GINI_double p2 = 1;   GINI_double p3 = 1;   GINI_double p4 = 1;   GINI_bool   sp = GINI_FALSE;   GINI_bool   cflag = GINI_FALSE;   GINI_bool   labelval = GINI_FALSE;   GINI_u32    SVM_DIMENSION;   GINI_u32    SVM_CLASS;   GINI_u32    SVM_DATA;   GINI_SVMKernel *kernel = (GINI_SVMKernel*)GINI_NULL;   GINI_int    count = 1;   // Check the number of input parameters.   if (( argc < 6 ) && ( argc > 7))   {      PrintHelp();      return 1;   }   GINI_bool validarg;   // Kernel definition goes here   while ( count < argc-3 )   {      validarg = GINI_FALSE;      if ( strcmp(argv[count],"-k") == 0 )      {         count++;         if ( strcmp(argv[count],"0") == 0 )		 ktype = GINISVMPOLY;	 else if ( strcmp(argv[count],"1") == 0 )		 ktype = GINISVMGAUSSIAN;	 else if ( strcmp(argv[count],"2") == 0 )		 ktype = GINISVMDTK;	 else if ( strcmp(argv[count],"3") == 0 )		 ktype = GINISVMTANH;	 else          {	     PrintHelp();	     return 1;         }	 validarg = GINI_TRUE;	 count++;      }         if ( strcmp(argv[count],"-p1") == 0 )      {         count++;	 p1 = atof(argv[count++]);	 validarg = GINI_TRUE;      }      if ( strcmp(argv[count],"-p2") == 0 )      {         count++;	 p2 = atof(argv[count++]);	 validarg = GINI_TRUE;      }       if ( strcmp(argv[count],"-p3") == 0 )      {         count++;	 p3 = atof(argv[count++]);	 validarg = GINI_TRUE;      }      if ( strcmp(argv[count],"-p4") == 0 )      {         count++;	 p4 = atof(argv[count++]);	 validarg = GINI_TRUE;      }      if ( strcmp(argv[count],"-sp") == 0 )      {         sp = GINI_TRUE;	 count++;	 validarg = GINI_TRUE;      }      if ( strcmp(argv[count],"-cflag") == 0 )      {         cflag = GINI_TRUE;	 count++;	 validarg = GINI_TRUE;      }      if ( strcmp(argv[count],"-label") == 0 )      {         labelval = GINI_TRUE;	 count++;	 validarg = GINI_TRUE;      }      if ( validarg == GINI_FALSE )      {         PrintHelp();	 return 1;      }   }   if ( count > argc - 3 )   {      PrintHelp();      return 1;   }   // Read the input training file and read the header.   // Read in the data from the file   FILE *fp = fopen(argv[argc-3],"r");   if ( fp == (FILE*) GINI_NULL )   {      printf("Test File not Present\n");      return 1;   }   FILE *fout = fopen(argv[argc-2],"r");   if ( fout == (FILE*) GINI_NULL )   {      printf("Cannot Open Configuration File for writing\n");      return 1;   }   FILE *fprob = fopen(argv[argc-1],"w");   if ( fprob == (FILE*) GINI_NULL )   {      printf("Cannot Open Probability File for writing\n");      return 1;   }   GINI_float value;   // First read in the dimensionality of the input   // vectors.   if ( ktype != GINISVMDTK )   {      fscanf(fp,"%f\n",&value);      SVM_DIMENSION = (GINI_u32)value;   }   else   {      SVM_DIMENSION = 0;   }   // Number of classes   fscanf(fp,"%f\n",&value);   SVM_CLASS = (GINI_u32)value;   // Total Number of training points   fscanf(fp,"%f\n",&value);   SVM_DATA = (GINI_u32)value;   // Initialize the kernel depending on the ktype.   switch (ktype)   {	   case GINISVMGAUSSIAN :		  kernel = new GINI_GaussianKernel(p1,sp);		  break;	   case GINISVMPOLY :		  kernel = new GINI_PolyKernel(p1,p2,(GINI_u32)p3,sp);		  break;	   case GINISVMDTK :		  kernel = new GINI_DTKKernel(p1,p2,p3,p4);		  SVM_DIMENSION = 0;		  break;	   case GINISVMTANH :		  kernel = new GINI_TanhKernel(p1,sp);		  break;   }   // Now define svm block and initialize it with the kernel   GINI_SVMBlock *svmmachine = new GINI_SVMBlock(kernel);   printf("Reading in GiniSVM parameters\n");   if ( svmmachine->Read(fout) == GINI_FALSE )   {      printf("SVM Initialization Failure: Check the kernel type and the data format\n");      return 1;   }   // Print out some the statistics.   printf("Total number of support vectors = %d\n",svmmachine->GetSize());   if ( svmmachine->GetDimension() != SVM_DIMENSION )   {      printf("Dimensionality of the SV differs from Test points !!!\n");      return 1;   }   if ( svmmachine->GetClasses() != SVM_CLASS )   {      printf("Number of classes differ between coefficients and Test points !!!\n");      return 1;   }   // Data structures to read in the training data.   GINI_double *testvec;   GINI_double *label;   GINI_double cval;   GINI_u32 currid,maxid;   GINI_double maxval;   GINI_u32 **confusion = (GINI_u32**) GINI_NULL;   currid = 0;   if ( labelval == GINI_TRUE )   {      confusion = new (GINI_u32*)[SVM_CLASS];      if ( confusion == ( GINI_u32**) GINI_NULL )      {         printf("Memory Allocation Failure\n");         return 1;      }      for ( GINI_u32 i = 0; i < SVM_CLASS; i++ )      {          confusion[i] = new (GINI_u32)[SVM_CLASS];          if ( confusion[i] == ( GINI_u32*) GINI_NULL )          {             printf("Memory Allocation Failure\n");             return 1;          }          for ( GINI_u32 j = 0; j < SVM_CLASS; j++ )          {               confusion[i][j] = 0;          }      }   }   // Allocate memory for the label vector   label = new GINI_double[SVM_CLASS];   for ( GINI_u32 i = 0; i < SVM_DATA; i++ )   {      if ( labelval == GINI_TRUE )      {         fscanf(fp,"%f\n",&value);         if ( value >= SVM_CLASS)         {            printf("Improper Label: Expected < %d, Got %d\n",SVM_CLASS,(GINI_u32)value);            return 1;         }         // Allocate memory for the label vector         for ( GINI_u32 j = 0; j< SVM_CLASS; j++ )         {            if ( j != value)            {               label[j]= 0;            }            else            {               label[j] = 1;	       currid = j;            }         }      }      cval = 1.0;         if ( cflag == GINI_TRUE )      {         // Read in the C value for this data point         fscanf(fp,"%f\n",&value);         cval = (GINI_double)value;      }      if ( sp == GINI_FALSE )      {         // If the data is in a non-sparse format	 if ( ktype == GINISVMDTK )         {            // If this is a DTK kernel then we have to	    // process variable length data.            fscanf(fp,"%f\n",&value);            testvec = new GINI_double[(GINI_u32)value+1];	    testvec[0] = (GINI_double)value;            for ( GINI_u32 j = 0; j< (GINI_u32)testvec[0]; j++ )            {               fscanf(fp,"%f\n",&value);               testvec[j+1] = (GINI_double)value;            }         }	 else         {            // Allocate memory for the training vector            testvec = new GINI_double[SVM_DIMENSION];            for ( GINI_u32 j = 0; j< SVM_DIMENSION; j++ )            {               fscanf(fp,"%f\n",&value);               testvec[j] = (GINI_double)value;            }         }      }      else      {         // If the data is in a sparse format.         fscanf(fp,"%f\n",&value);         testvec = new GINI_double[(GINI_u32)(2*value)+1];	 testvec[0] = (GINI_double)value;         for ( GINI_u32 j = 0; j< (GINI_u32)testvec[0]; j++ )         {            // Read in the Index and then the value.            fscanf(fp,"%f\n",&value);            testvec[2*j+1] = (GINI_double)value;            fscanf(fp,"%f\n",&value);            testvec[2*j+2] = (GINI_double)value;         }      }      // Compute the Probability      svmmachine->GiniProb(testvec,label);      // Print the probability output for the corresponding      // vector      //fprintf(fprob,"Data id = %5d, ",i);      for ( GINI_u32 j = 0; j<SVM_CLASS; j++ )      {          fprintf(fprob,"%1.4f  ",label[j]);      }      fprintf(fprob,"\n");      if (labelval == GINI_TRUE )      {         maxval = 0;         maxid = 0;         for (GINI_u32 j=0; j< SVM_CLASS; j++ )         {             if ( maxval < label[j] )             {                  maxval = label[j];                  maxid = j;             }         }         confusion[maxid][currid]++;      }      //printf("Dataid = %d, True Class = %d, Hypothesis = %d\n",i,currid,maxid);      delete [] testvec;   }   fclose(fp);   fclose(fprob);   if ( labelval == GINI_TRUE )   {      printf("---------------CONFUSION MATRIX------------\n");      GINI_u32 errrate = 0;      for ( GINI_u32 i = 0; i < SVM_CLASS; i++ )      {          for ( GINI_u32 j = 0; j < SVM_CLASS; j++ )          {              printf("%4d ",confusion[i][j]);              if ( i == j)              {                  errrate += confusion[i][j];              }          }          printf("\n");      }      printf("Error rate = %f\n",(GINI_float)(SVM_DATA-errrate)/SVM_DATA*100);   }   // Free all the memory.   delete svmmachine;   delete [] label;   delete kernel;   if ( labelval == GINI_TRUE )   {      for ( GINI_u32 i = 0; i< SVM_CLASS; i++ )      {         delete [] confusion[i];      }      delete [] confusion;   }   return 0;}

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色综合天天综合网国产成人综合天 | 在线观看免费成人| 婷婷夜色潮精品综合在线| 欧美不卡在线视频| 91一区二区在线观看| 日韩av高清在线观看| 国产精品你懂的在线欣赏| 中文字幕成人av| 欧美久久一二区| 色久综合一二码| 99热精品国产| 亚洲国产精品久久人人爱| 欧洲激情一区二区| 成人黄色av网站在线| 日韩综合小视频| 自拍av一区二区三区| 精品免费日韩av| 欧美精品tushy高清| 91丨porny丨最新| 成人久久久精品乱码一区二区三区| 天天操天天色综合| 亚洲图片欧美综合| 亚洲一区二区三区四区五区中文| 国产精品欧美一区二区三区| 久久久精品综合| 久久综合狠狠综合久久激情| 中文字幕在线一区| 国产午夜三级一区二区三| 久久女同精品一区二区| 欧美mv日韩mv国产| 久久九九久久九九| 国产精品国产三级国产aⅴ原创| 国产午夜精品一区二区三区视频| 26uuu亚洲| 国产精品全国免费观看高清| 亚洲欧美视频在线观看| 亚洲一区在线观看视频| 视频一区二区三区入口| 久久99热这里只有精品| 国产精品一区二区果冻传媒| 99久久精品国产麻豆演员表| 99久久综合精品| 555夜色666亚洲国产免| 亚洲精品一区二区三区在线观看| 久久久国产精品午夜一区ai换脸| 欧美国产日本视频| 亚洲一区二区3| 国产精品一二三| 欧美猛男男办公室激情| 国产精品免费看片| 日韩二区三区四区| 91在线视频网址| 久久精品在线免费观看| 亚洲一区二区欧美日韩| 国产一区二区伦理| 欧美视频一区二区在线观看| 久久精品亚洲乱码伦伦中文| 亚洲一本大道在线| av不卡在线观看| 久久一日本道色综合| 亚洲成a人v欧美综合天堂下载| 国产精品1区2区| 欧美伊人精品成人久久综合97| 国产亚洲一区二区三区在线观看| 亚洲国产日韩a在线播放性色| 国产精品99久久不卡二区| 日韩欧美高清一区| 亚洲成av人片在线| 色婷婷av一区二区三区大白胸| 精品少妇一区二区三区在线视频| 亚洲一区二区三区精品在线| 99国产一区二区三精品乱码| 国产三级欧美三级日产三级99| 亚洲国产sm捆绑调教视频| 日本丰满少妇一区二区三区| 国产精品免费丝袜| 在线一区二区观看| eeuss鲁片一区二区三区在线看| 成人毛片老司机大片| 国产精品88888| 久久久久一区二区三区四区| 五月综合激情网| 欧美视频一区在线观看| 亚洲人成在线播放网站岛国| 国产成人午夜视频| 2021中文字幕一区亚洲| 国产一区二区精品久久99| 精品久久免费看| 国产一区二区91| 久久婷婷久久一区二区三区| 一区二区在线观看免费视频播放 | 日韩美女在线视频| 亚洲自拍都市欧美小说| 欧美高清www午色夜在线视频| 欧美国产日韩亚洲一区| 色综合久久88色综合天天6| 久久九九99视频| 色一区在线观看| 亚洲色图都市小说| 欧美日韩精品一区视频| 亚洲福利一区二区| 日韩欧美一级在线播放| 久久99国产精品免费| 日本一区二区高清| 国产999精品久久久久久| 伊人色综合久久天天| 欧美日韩国产高清一区二区三区 | 欧美另类videos死尸| 六月丁香婷婷色狠狠久久| 中文字幕免费在线观看视频一区| 99精品视频在线观看免费| 日韩中文字幕不卡| 久久久精品免费网站| 在线观看免费亚洲| 日本va欧美va欧美va精品| 国产欧美一区二区在线观看| av电影天堂一区二区在线| 麻豆精品视频在线观看| 1000精品久久久久久久久| 日韩午夜激情视频| 欧美私人免费视频| 99天天综合性| 国内不卡的二区三区中文字幕| 亚洲成人免费av| 成人欧美一区二区三区1314| 亚洲精品一区二区三区在线观看 | 精品亚洲国产成人av制服丝袜 | 精品国产乱码久久久久久闺蜜| 国产精品一二三区在线| 免费xxxx性欧美18vr| 亚洲免费高清视频在线| 中文字幕亚洲不卡| 国产欧美久久久精品影院| 精品国产百合女同互慰| 日韩欧美www| 欧美调教femdomvk| 欧美精品色综合| 色婷婷综合激情| 色综合久久中文综合久久97| 国产大片一区二区| 久久精品国产77777蜜臀| 久久午夜色播影院免费高清| 婷婷国产v国产偷v亚洲高清| 国产不卡视频一区二区三区| 国产美女在线观看一区| 国内精品写真在线观看| 国产专区欧美精品| 懂色av中文字幕一区二区三区| 国产精品一区二区黑丝| av男人天堂一区| 欧美人与z0zoxxxx视频| 26uuu精品一区二区| 国产日本欧洲亚洲| ●精品国产综合乱码久久久久| 亚洲人吸女人奶水| 日韩极品在线观看| 美女视频黄频大全不卡视频在线播放| 视频一区二区三区在线| 日本网站在线观看一区二区三区| 另类的小说在线视频另类成人小视频在线 | 欧美专区日韩专区| 久久久久久综合| 一区二区三区**美女毛片| 蜜桃视频在线观看一区二区| 免费亚洲电影在线| 色噜噜夜夜夜综合网| 欧美高清视频www夜色资源网| 337p粉嫩大胆色噜噜噜噜亚洲| 一区二区三区中文字幕精品精品| 秋霞电影一区二区| 一本久久a久久免费精品不卡| 欧美一区二区福利视频| 中文字幕亚洲视频| 日韩av电影免费观看高清完整版在线观看 | 久久久久久久久久美女| 视频一区中文字幕国产| 在线观看免费成人| 久久伊99综合婷婷久久伊| 午夜欧美一区二区三区在线播放| 99国产精品久久久| 国产精品色在线观看| 国产精品一级片在线观看| 日韩区在线观看| 亚洲乱码国产乱码精品精98午夜 | 国产99久久久国产精品免费看| 欧美一二三四区在线| 亚洲电影在线免费观看| 91免费版pro下载短视频| 国产欧美一区二区三区在线老狼 | 亚洲一区二区三区四区五区中文 | 国产精品毛片a∨一区二区三区| 极品少妇一区二区| 日韩一二三区视频| 六月丁香婷婷色狠狠久久| 日韩一区二区精品| 亚洲高清免费在线| 欧美老人xxxx18| 午夜精品在线看| 2021国产精品久久精品| 99国产精品99久久久久久|