亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩中文字幕91| 欧美中文字幕亚洲一区二区va在线 | 久久久久久日产精品| 国产精品伦一区| 老司机精品视频一区二区三区| 99riav久久精品riav| 精品久久久网站| 亚洲成av人影院在线观看网| 成人一区二区三区中文字幕| 日韩欧美123| 五月天网站亚洲| 972aa.com艺术欧美| 久久先锋影音av| 蜜臀国产一区二区三区在线播放| 91免费版在线| 国产精品美女视频| 国产伦精品一区二区三区在线观看| 欧美三级日本三级少妇99| 亚洲欧美日韩国产另类专区 | 午夜精品久久久久影视| 国产毛片精品国产一区二区三区| 欧美丰满一区二区免费视频 | 亚洲精品一区二区三区精华液| 夜夜嗨av一区二区三区网页 | 国产成人免费视| 亚洲精品一线二线三线无人区| 亚洲高清免费观看| 欧美性xxxxxx少妇| 一区二区在线免费观看| 成人的网站免费观看| 日本一区二区三区在线不卡| 国产一区二区久久| 国产欧美一区二区三区沐欲 | 亚洲精品一区二区三区影院| 美日韩黄色大片| 欧美成人精品3d动漫h| 免费人成黄页网站在线一区二区| 91精品国产欧美一区二区成人 | 色婷婷av一区| 一二三四区精品视频| 色综合中文字幕| 一区二区三区欧美亚洲| 欧美亚洲国产bt| 婷婷丁香久久五月婷婷| 欧美一区二区精品在线| 麻豆国产欧美日韩综合精品二区| 欧美电影免费观看高清完整版在线| 男男gaygay亚洲| 久久蜜臀中文字幕| 国产精品一区二区男女羞羞无遮挡| 国产清纯美女被跳蛋高潮一区二区久久w| 久草热8精品视频在线观看| 久久亚区不卡日本| 91在线视频免费91| 一区二区三区国产精品| 91精品视频网| 国产精品996| 一区二区三区欧美亚洲| 26uuu亚洲综合色| 成人综合婷婷国产精品久久| 亚洲视频你懂的| 欧美二区在线观看| 国产麻豆9l精品三级站| 亚洲欧美日韩电影| 日韩一区二区三| av一区二区久久| 日韩不卡一区二区| 国产精品久久久久久久久久免费看| 91精彩视频在线观看| 久久99久久99精品免视看婷婷 | 国产精品美女久久久久久久网站| 色吊一区二区三区| 狠狠色狠狠色综合日日91app| 国产精品久久久久久福利一牛影视 | 五月婷婷色综合| 国产亚洲一区二区三区四区| 91免费在线看| 久久99久久99精品免视看婷婷 | 日韩精品专区在线影院观看| www.在线欧美| 美腿丝袜亚洲色图| 亚洲一区在线观看视频| 久久婷婷一区二区三区| 欧美三级视频在线播放| 成人美女视频在线观看18| 青草av.久久免费一区| 亚洲女同女同女同女同女同69| 精品欧美一区二区三区精品久久| 色婷婷精品久久二区二区蜜臂av| 国产一区二区导航在线播放| 性欧美疯狂xxxxbbbb| 亚洲视频一二三区| 国产日韩欧美制服另类| 精品国产一区二区三区久久久蜜月| 在线免费观看日本欧美| 99久久99久久综合| 国产高清精品网站| 蜜桃传媒麻豆第一区在线观看| 一区二区三区高清| √…a在线天堂一区| 日本一区二区视频在线观看| 精品三级在线看| 91精品国产美女浴室洗澡无遮挡| 日本大香伊一区二区三区| 成人av片在线观看| www.色综合.com| 国产成人精品免费网站| 国产一区二区福利| 国产精品亚洲а∨天堂免在线| 精品亚洲porn| 久久成人免费网| 久久99最新地址| 极品少妇xxxx偷拍精品少妇| 美女一区二区三区在线观看| 日本va欧美va瓶| 麻豆成人在线观看| 日韩成人伦理电影在线观看| 日本欧美一区二区三区乱码| 奇米影视一区二区三区小说| 日本免费新一区视频| 日本美女一区二区| 免费观看在线色综合| 久久99精品久久久| 国产精品一区一区三区| 成人精品视频网站| 色综合久久久久网| 337p亚洲精品色噜噜狠狠| 欧美精品日日鲁夜夜添| 日韩免费观看高清完整版在线观看| 欧美变态口味重另类| 国产偷国产偷精品高清尤物| 中文字幕一区不卡| 亚洲高清不卡在线| 美女视频黄免费的久久| 国产福利一区二区三区| 99久久精品免费看| 欧美日韩精品欧美日韩精品一| 欧美一区二区在线免费播放| 欧美不卡一区二区三区四区| 国产精品网站在线| 一区二区三区国产| 九九国产精品视频| youjizz国产精品| 7777精品伊人久久久大香线蕉超级流畅 | 欧美亚洲一区三区| 日韩一区二区三区高清免费看看| 久久色中文字幕| 亚洲欧美一区二区三区国产精品 | av一本久道久久综合久久鬼色| 99视频精品全部免费在线| 在线观看免费一区| 欧美成人video| 亚洲人午夜精品天堂一二香蕉| 亚洲成a人在线观看| 国产一区视频在线看| 91福利在线看| 国产亚洲一区二区在线观看| 亚洲综合丝袜美腿| 国产成人精品综合在线观看 | 亚洲欧美一区二区久久| 亚洲r级在线视频| 国产·精品毛片| 91麻豆精品久久久久蜜臀| 中国色在线观看另类| 午夜精品久久久久久久99樱桃 | 欧美激情一区二区三区蜜桃视频 | 一本久道久久综合中文字幕| 日韩午夜电影av| 一区二区三区免费在线观看| 国产一区二区三区美女| 欧美日韩精品欧美日韩精品一| 国产精品久久三区| 精品一区二区久久久| 欧美日韩国产天堂| 《视频一区视频二区| 国产精品白丝av| 欧美大片一区二区| 亚洲国产成人高清精品| 99视频在线精品| 国产欧美一区二区三区网站 | 欧美精品一区视频| 天天影视涩香欲综合网| 色先锋资源久久综合| 中文字幕+乱码+中文字幕一区| 美女尤物国产一区| 91精品国产综合久久久久久久| 亚洲视频一区二区在线| 99久久免费精品高清特色大片| 国产欧美一二三区| 国产精品一线二线三线精华| 欧美va亚洲va| 免费在线观看日韩欧美| 51精品秘密在线观看| 婷婷综合久久一区二区三区| 欧美性色欧美a在线播放| 一区二区三区丝袜| 91豆麻精品91久久久久久| 亚洲女人****多毛耸耸8| 一本到不卡精品视频在线观看| 亚洲四区在线观看|