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

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

?? svmfusvmkerncache.cpp

?? This is SvmFu, a package for training and testing support vector machines (SVMs). It s written in C
?? CPP
?? 第 1 頁 / 共 2 頁
字號:
//     This is a part of the SvmFu library, a library for training//     Support Vector Machines.  Copyright (C) 2000 rif and MIT////     Contact: rif@mit.edu//     This program is free software; you can redistribute it and/or//     modify it under the terms of the GNU General Public License as//     published by the Free Software Foundation; either version 2 of//     the License, or (at your option) any later version.//     This program is distributed in the hope that it will be useful,//     but WITHOUT ANY WARRANTY; without even the implied warranty of//     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the//     GNU General Public License for more details.//     You should have received a copy of the GNU General Public//     License along with this program; if not, write to the Free//     Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,//     MA 02111-1307 USAusing namespace std;#include <stdio.h>#include <iostream>#include <fstream>#include "SvmFuSvmKernCache.h"// for set_difference#include <algorithm>#ifdef CallTemplate#undef CallTemplate#endif#define CallTemplate(rettype, funcname) \template<class DataPt, class KernVal> \rettype SvmKernCache<DataPt, KernVal>::funcname#ifdef InlineTemplate#undef InlineTemplate#endif#define InlineTemplate(rettype, funcname) \template<class DataPt, class KernVal> \rettype SvmKernCache<DataPt, KernVal>::funcname/*! \class SvmKernCache * * New design by vking@mit.edu, spring 2001. * * Maintains a row and column for each point in the working set, * plus a configurable number of extra rows which are assigned * to the most violating points from outside the working set. * All kernel computations are now done internally on demand. * Kernel product access functions are available for working set * indices and training set indices. * * Original rif comments: *  * It's designed to be passed and forth between SmallOpt and  * LargeOpt.  There is some redundancy here (both the Svm and the * KernCache store the trnSetPtr and the kernProdFuncPtr, sadly; this * could potentially lead to hard-to-find bugs later) * Even though it is redundant, we store full rows.  We could save half * the space by storing in an upper triangular form, but then we would * take longer and have to copy to provide entire rows, which is the most  * common operation. * * Index arguments to functions are into the full training set, * not the working set. Mappings from working set indices to * training set indices are left to using code. */template<class DataPt, class KernVal>SvmKernCache<DataPt, KernVal>::SvmKernCache(int workingSetSize, int extraRows, int trnSetSize, const DataPt * const trnSetPtr, const KernVal (*kernProdFuncPtr)(const DataPt &,				  const DataPt &))  : columns_(workingSetSize), rows_(workingSetSize + extraRows),    trnSetSize_(trnSetSize), trnSetPtr_(trnSetPtr),    kernProdFuncPtr_(kernProdFuncPtr){   if (rows_ > trnSetSize_) rows_ = trnSetSize_;  kernelRows_ = new KernVal *[rows_];  kernelRowsGeneratedP_ = new bool[rows_];  kernelRowsAllocatedP_ = new bool[rows_];    colToTrnSet_ = new int[columns_];  rowToTrnSet_ = new int[rows_];  trnSetToRow_ = new int[trnSetSize_];  trnSetToCol_ = new int[trnSetSize_];  for (int i = 0; i < columns_; i++)  {    colToTrnSet_[i] = -1;  }    for (int i = 0; i < rows_; i++) {    rowToTrnSet_[i] = -1;    kernelRowsGeneratedP_[i] = false;    kernelRowsAllocatedP_[i] = false;  }    for (int i = 0; i < trnSetSize_; i++)  {    trnSetToRow_[i] = -1;    trnSetToCol_[i] = -1;  }  kernelComputations_ = 0;  readFromFile_ = false;}  template<class DataPt, class KernVal>SvmKernCache<DataPt, KernVal>::~SvmKernCache() {  int rA = 0;  for (int i = 0; i < rows_; i++) {    if (kernelRowsAllocatedP_[i]) {      rA++;      delete[] kernelRows_[i];    }  }  cout << "ROWS ALLOCATED: " << rA << endl;  cout << "KERNEL COMPUTATIONS: " << kernelComputations_ << endl;  delete[] kernelRows_;  delete[] kernelRowsGeneratedP_;  delete[] kernelRowsAllocatedP_;  delete[] rowToTrnSet_;  delete[] colToTrnSet_;  delete[] trnSetToRow_;  delete[] trnSetToCol_;}/*! \fn SvmKernCache<DataPt, KernVal>::workingSetChanged (int *, set<QueueElt_) * * Assign a column to each point specified by workingSetIndices * and an extra row to as many of the points from the top of * others as space allows. * * Algorithm: use the new working set array as our column assignments. * Then compute the set of points to add to rows and the set of points * to remove from rows by subtracting the new set of points we want to * assign rows from the points that are currently assigned to rows, * and swap the two sets pairwise. * */template<class DataPt, class KernVal> voidSvmKernCache<DataPt, KernVal>::workingSetChanged(const int * const workingSet, const priority_queue<QueueElt_> &others){  // copy non-working-set queue  priority_queue<QueueElt_> nonWorkingSet = others;  // for rows and columns  set<int> pointsToCache;  set<int> currentlyCachedPoints;  // for rows  list<int> pointsToRemoveFromRows;  list<int> pointsToAddToRows;  list<int> availableRows;  // for columns  list<int> pointsToRemoveFromCols;  list<int> pointsToAddToCols;  list<int> availableCols;  //////////////////////////////  // update column assignments  //////////////////////////////  // we assign columns in the same order as the working set,  // because it's guaranteed to be an optimal assignment,  // and because it lets us pass out pointers to cache rows  // which are in the same order as the working set.  list<int> reassignedCols;  for (int i = 0; i < columns_; i++)    {      // remember which columns changed, adjust mappings      if (colToTrnSet_[i] != workingSet[i]) {	reassignedCols.push_back(i);	if (colToTrnSet_[i] != -1) {	  trnSetToCol_[colToTrnSet_[i]] = -1;	}	colToTrnSet_[i] = workingSet[i];	trnSetToCol_[workingSet[i]] = i;      }    }    // invalidate the columns row-wise to help linearity of reference  if (!readFromFile_) {    for (int cacheRow = 0; cacheRow < rows_; cacheRow++)      {	kernelRowsGeneratedP_[cacheRow] = false; // sadly...	if (kernelRowsAllocatedP_[cacheRow])	  {	    for (list<int>::iterator it = reassignedCols.begin();		 it != reassignedCols.end(); it++)	      {		invalidateCell(cacheRow, *it);	      }	  }      }  }  ///////////////////////////  // update row assignments  ///////////////////////////      // collect points from the new working set  for (int i = 0; i < columns_; i++)    {      pointsToCache.insert(workingSet[i]);    }  // collect sets from our row mapping  for (int i = 0; i < rows_; i++)    {      if (rowToTrnSet_[i] != -1) {	currentlyCachedPoints.insert(rowToTrnSet_[i]);      } else {	availableRows.push_back(i);      }    }  // gather enough points off the queue to fill up our extra rows  int nws_size = nonWorkingSet.size();  for (int i = 0; (i < rows_ - columns_) && (i < nws_size); i++)    {      pointsToCache.insert(nonWorkingSet.top().elt_);      nonWorkingSet.pop();    }    // compute their differences  set_difference(currentlyCachedPoints.begin(),		 currentlyCachedPoints.end(),		 pointsToCache.begin(),		 pointsToCache.end(),		 inserter(pointsToRemoveFromRows,			  pointsToRemoveFromRows.begin()));    set_difference(pointsToCache.begin(),		 pointsToCache.end(),		 currentlyCachedPoints.begin(),		 currentlyCachedPoints.end(),		 inserter(pointsToAddToRows,			  pointsToAddToRows.begin()));    // for each point to add, either swap it with the next point  // to remove, or assign it to an empty row  list<int>::iterator pointToRemove = pointsToRemoveFromRows.begin();  list<int>::iterator emptyRow = availableRows.begin();  for (list<int>::iterator it = pointsToAddToRows.begin();       it != pointsToAddToRows.end(); it++) {    int trnSetPtToAdd = *it;    int destRow;        if (pointToRemove != pointsToRemoveFromRows.end())      {	int trnSetIndex = *pointToRemove;	pointToRemove++;	destRow = trnSetToRow_[trnSetIndex];		// purge obsolete point from map	trnSetToRow_[trnSetIndex] = -1;      }    else      {	destRow = *emptyRow;	emptyRow++;      }        // update our mappings    rowToTrnSet_[destRow] = trnSetPtToAdd;    trnSetToRow_[trnSetPtToAdd] = destRow;        // mark the row as invalid    if (kernelRowsAllocatedP_[destRow] && !readFromFile_)      {	for (int i = 0; i < columns_; i++)	  {	    invalidateCell(destRow, i);	  }      }  }}CallTemplate(void, saveToFile)(char *fileName){

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产高清一区| 亚洲婷婷国产精品电影人久久| 精品国产免费一区二区三区香蕉| 国产无人区一区二区三区| 一区二区三区国产精华| 国产久卡久卡久卡久卡视频精品| 在线看不卡av| 久久久国产精华| 日韩精品福利网| 日本久久电影网| 久久久精品欧美丰满| 日精品一区二区| 91丝袜呻吟高潮美腿白嫩在线观看| 亚洲精品一区二区在线观看| 亚洲午夜精品一区二区三区他趣| 成人av在线看| 久久伊人蜜桃av一区二区| 香蕉久久一区二区不卡无毒影院| 成人av电影在线观看| 久久尤物电影视频在线观看| 午夜精品免费在线| 在线看不卡av| 一区二区三区在线观看网站| www.日韩在线| 国产精品乱码久久久久久| 精品午夜久久福利影院| 欧美一二三区在线观看| 午夜精品一区在线观看| 欧美色涩在线第一页| 亚洲精品免费播放| 91社区在线播放| 亚洲色图欧洲色图| 91视频国产观看| 亚洲日本在线a| 91蜜桃网址入口| 亚洲激情六月丁香| 91蜜桃网址入口| 一区二区不卡在线播放| 色婷婷激情综合| 亚洲精品欧美二区三区中文字幕| 97久久久精品综合88久久| 国产精品国产精品国产专区不片| 国产高清成人在线| 欧美极品aⅴ影院| www.欧美色图| 一区二区不卡在线播放| 欧美日韩美女一区二区| 日韩综合在线视频| 精品国产麻豆免费人成网站| 狠狠网亚洲精品| 久久久午夜精品| 99综合影院在线| 亚洲一区二区高清| 精品久久国产字幕高潮| 蜜臀久久99精品久久久久久9| 91精品国产91久久久久久一区二区 | 3atv一区二区三区| 日本午夜一本久久久综合| 欧美成人综合网站| 国产精品1区二区.| 亚洲精品日韩一| 欧美一二三区在线| 国产.欧美.日韩| 亚洲一区视频在线观看视频| 91精品国产综合久久久久| 国产麻豆日韩欧美久久| 国产精品久久久久久久久快鸭 | 日韩精品中午字幕| 成人av在线电影| 五月婷婷久久综合| 国产喷白浆一区二区三区| 色狠狠一区二区| 激情综合网激情| 亚洲精品成人a在线观看| 日韩精品一区二区三区四区视频 | 亚洲人成网站影音先锋播放| 欧美性大战xxxxx久久久| 九九精品一区二区| 亚洲乱码一区二区三区在线观看| 9191成人精品久久| 国产成人aaaa| 日本色综合中文字幕| 国产精品理论在线观看| 欧美一区二区三区四区视频| 成人h动漫精品一区二| 日韩二区三区四区| 亚洲视频 欧洲视频| 精品国内二区三区| 欧美日韩国产一级片| 波多野结衣一区二区三区| 蜜臀久久99精品久久久画质超高清| 国产精品国产三级国产aⅴ入口 | 亚洲视频你懂的| 欧美变态tickling挠脚心| 欧洲一区二区三区免费视频| 国产高清在线精品| 蜜桃久久久久久久| 亚洲成人中文在线| 亚洲欧洲精品一区二区三区不卡| 欧美xxxxxxxxx| 国产精品美女一区二区| 精品少妇一区二区三区在线视频| 色婷婷狠狠综合| 成人国产精品免费观看视频| 韩日精品视频一区| 麻豆精品在线观看| 青青草原综合久久大伊人精品 | 久久在线观看免费| 欧美成人a∨高清免费观看| 6080yy午夜一二三区久久| 91麻豆视频网站| 成年人网站91| 国产福利不卡视频| 国产精品影视在线| 国产一区啦啦啦在线观看| 狂野欧美性猛交blacked| 日日骚欧美日韩| 日韩成人精品在线| 五月婷婷激情综合网| 亚洲gay无套男同| 午夜精品福利视频网站| 亚洲成人av一区二区| 午夜欧美一区二区三区在线播放| 五月天久久比比资源色| 午夜激情久久久| 日韩和的一区二区| 麻豆精品视频在线观看免费| 麻豆91精品91久久久的内涵| 精品一区二区三区蜜桃| 国产在线精品一区二区| 国产高清不卡一区二区| 成人激情小说网站| 99re视频精品| 欧美日韩午夜影院| 91精品国产欧美一区二区18| 欧美xxxxxxxx| 中文字幕av一区 二区| 亚洲色图第一区| 亚洲国产日韩一区二区| 免费视频最近日韩| 国产福利精品导航| 一本一道久久a久久精品| 欧美日韩成人高清| 亚洲免费观看高清| 五月天激情综合网| 国产综合色在线| 成人性色生活片免费看爆迷你毛片| 成人免费看黄yyy456| 在线免费观看视频一区| 日韩美女主播在线视频一区二区三区| 2020日本不卡一区二区视频| 国产精品欧美精品| 午夜精品久久久久久不卡8050| 极品美女销魂一区二区三区| 99视频精品免费视频| 欧美日韩国产综合一区二区| 久久一日本道色综合| 国产精品久久久久永久免费观看 | 国产精品激情偷乱一区二区∴| 亚洲最快最全在线视频| 免费的国产精品| 成人黄页毛片网站| 欧美精品乱码久久久久久| 国产三级精品在线| 亚洲丶国产丶欧美一区二区三区| 国内不卡的二区三区中文字幕 | 91黄色免费看| 久久久噜噜噜久久人人看 | 男女性色大片免费观看一区二区 | 色屁屁一区二区| 国产亚洲欧美中文| 日日夜夜免费精品| 91小视频在线| 国产色婷婷亚洲99精品小说| 亚洲国产wwwccc36天堂| 国产成人日日夜夜| 91麻豆精品国产91久久久久久| 国产精品国产自产拍在线| 久久国产精品免费| 欧美色爱综合网| 中文字幕欧美一| 国产精品自产自拍| 日韩欧美资源站| 亚洲一级在线观看| 99re热视频这里只精品| 国产人成亚洲第一网站在线播放| 日韩中文字幕亚洲一区二区va在线 | 亚洲一区二区三区国产| 成人av网站在线观看| 亚洲精品在线电影| 免费成人在线影院| 欧美一区二区在线看| 亚洲第一二三四区| 日本精品一区二区三区高清| 国产精品无码永久免费888| 久久99久久久久久久久久久| 欧美日韩国产成人在线免费| 夜夜嗨av一区二区三区中文字幕| 成人晚上爱看视频| 国产精品久久久久永久免费观看|