Skip to content

raccoote/SVM-cifar10

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 

Repository files navigation

SVM-pytorch

My implementation of the Support Vector Machine (SVM) focused on classifying two classes from the CIFAR-10 dataset: airplane (label 0) and dog (label 5). As part of my college project, I built the SVM from scratch, exploring both primal and dual approaches.

My model supports the four different kernels that are found in the Wikipedia article:

  1. Polynomial (homogeneous) kernel:: k(xi,xj)=(xi⋅xj) d . When d=1, it becomes the linear kernel.
  2. Polynomial (inhomogeneous) kernel:: k(xi,xj)=(xi⋅xj+r) d .
  3. Gaussian (Radial Basis Function - RBF) kernel: k(xi,xj)=exp(−γ∥xi−xj∥ 2 )k(xi,xj)=exp(−γ ∥ xi−xj ∥ 2 ), where γ>0.
  4. Sigmoid (Hyperbolic tangent) kernel: k(xi,xj)=tanh(κxi⋅xj+c) for some (but not all) κ>0 και c<0.

image

Below we see the results of the SVM (training times, training/test accuracies) after many trials and parameter modifications. Due to computational restraints, only tests on primal SVM were taken:(

image

image

image

image

About

built from scratch!!

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages