Changeset 330 for trunk/lib/svm/SVM.cc


Ignore:
Timestamp:
Jun 1, 2005, 11:30:47 PM (17 years ago)
Author:
Peter
Message:

added an abstract base class for Kernel from which Kernel_SEV Kernel_MEV are inherited. Also added a separate class for viewing into subKernels

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/lib/svm/SVM.cc

    r323 r330  
    44#include <c++_tools/svm/SVM.h>
    55
    6 #include <c++_tools/svm/Kernel_MEV.h>
     6#include <c++_tools/svm/Kernel.h>
    77#include <c++_tools/gslapi/matrix.h>
    88#include <c++_tools/gslapi/vector.h>
     
    137137  }
    138138
    139   SVM::SVM(const Kernel_MEV& kernel,
    140            const gslapi::vector& target)
     139  SVM::SVM(const Kernel& kernel, const gslapi::vector& target)
    141140           
    142141  : alpha_(target.size(),0),
    143142    bias_(0),
    144143    C_inverse_(0),
    145     kernel_(kernel),
     144    kernel_(&kernel),
    146145    max_epochs_(10000000),
    147146    output_(target.size(),0),
     
    160159  {
    161160    // initializing variables for optimization
    162     assert(target_.size()==kernel_.size());
     161    assert(target_.size()==kernel_->size());
    163162    assert(target_.size()==alpha_.size());
    164163
     
    358357      output_(i)=0;
    359358      for (size_t j=0; j<output_.size(); j++)
    360         output_(i)+=alpha_(j)*target_(j)*kernel_(i,j);
     359        output_(i)+=alpha_(j)*target_(j)*(*kernel_)(i,j);
    361360    }
    362361
Note: See TracChangeset for help on using the changeset viewer.