All Projects → Danko-Lab → Rgtsvm

Danko-Lab / Rgtsvm

Licence: other
The R package for SVM with GPU architecture based on the GTSVM software

Programming Languages

C++
36643 projects - #6 most used programming language
r
7636 projects
Cuda
1817 projects
M4
1887 projects
Makefile
30231 projects
c
50402 projects - #5 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to Rgtsvm

Machine Learning With Python
Python code for common Machine Learning Algorithms
Stars: ✭ 3,334 (+12248.15%)
Mutual labels:  svm, svr
Simplesvmhook
SimpleSvmHook is a research purpose hypervisor for Windows on AMD processors.
Stars: ✭ 159 (+488.89%)
Mutual labels:  svm
Textclf
TextClf :基于Pytorch/Sklearn的文本分类框架,包括逻辑回归、SVM、TextCNN、TextRNN、TextRCNN、DRNN、DPCNN、Bert等多种模型,通过简单配置即可完成数据处理、模型训练、测试等过程。
Stars: ✭ 105 (+288.89%)
Mutual labels:  svm
Tiny ml
numpy 实现的 周志华《机器学习》书中的算法及其他一些传统机器学习算法
Stars: ✭ 129 (+377.78%)
Mutual labels:  svm
Facial Expression Recognition Svm
Training SVM classifier to recognize people expressions (emotions) on Fer2013 dataset
Stars: ✭ 110 (+307.41%)
Mutual labels:  svm
Scene Text Recognition
Scene text detection and recognition based on Extremal Region(ER)
Stars: ✭ 146 (+440.74%)
Mutual labels:  svm
Defect Detection Classifier
Visual Defect Detection on Boiler Water Wall Tube Using Small Dataset
Stars: ✭ 91 (+237.04%)
Mutual labels:  svm
svm-pytorch
Linear SVM with PyTorch
Stars: ✭ 149 (+451.85%)
Mutual labels:  svm
Ml Course
Starter code of Prof. Andrew Ng's machine learning MOOC in R statistical language
Stars: ✭ 154 (+470.37%)
Mutual labels:  svm
Ml Projects
ML based projects such as Spam Classification, Time Series Analysis, Text Classification using Random Forest, Deep Learning, Bayesian, Xgboost in Python
Stars: ✭ 127 (+370.37%)
Mutual labels:  svm
Mylearn
machine learning algorithm
Stars: ✭ 125 (+362.96%)
Mutual labels:  svm
Vehicle Detection Yolo Ver
real-time Vehicle Detection( tiny YOLO ver) and HOG+SVM method
Stars: ✭ 111 (+311.11%)
Mutual labels:  svm
Dash Svm
Interactive SVM Explorer, using Dash and scikit-learn
Stars: ✭ 147 (+444.44%)
Mutual labels:  svm
Mnist Classification
Pytorch、Scikit-learn实现多种分类方法,包括逻辑回归(Logistic Regression)、多层感知机(MLP)、支持向量机(SVM)、K近邻(KNN)、CNN、RNN,极简代码适合新手小白入门,附英文实验报告(ACM模板)
Stars: ✭ 109 (+303.7%)
Mutual labels:  svm
Speech Emotion Recognition
Speech emotion recognition implemented in Keras (LSTM, CNN, SVM, MLP) | 语音情感识别
Stars: ✭ 181 (+570.37%)
Mutual labels:  svm
Augmentedgaussianprocesses.jl
Gaussian Process package based on data augmentation, sparsity and natural gradients
Stars: ✭ 99 (+266.67%)
Mutual labels:  svm
Sinaweibo Emotion Classification
新浪微博情感分析应用
Stars: ✭ 118 (+337.04%)
Mutual labels:  svm
Svm Classification Localization
HoG, PCA, PSO, Hard Negative Mining, Sliding Window, Edge Boxes, NMS
Stars: ✭ 130 (+381.48%)
Mutual labels:  svm
golinear
liblinear bindings for Go
Stars: ✭ 45 (+66.67%)
Mutual labels:  svm
Clandmark
Open Source Landmarking Library
Stars: ✭ 204 (+655.56%)
Mutual labels:  svm

Rgtsvm

The e1071 compatibility SVM package for GPU architecture based on the GTSVM software.

Vignette (https://github.com/Danko-Lab/Rgtsvm/blob/master/Rgtsvm-vignette.pdf).

Intoduction:

SVM is a popular and powerful machine learning method for classification, regression, and other learning tasks. In the R community, many users use the e1071 package, which offers an interface to the C++ implementation of libsvm, featuring with C classification, epsilon regression, one class classification, eregression, v regression, cross validation, parameter tuning and four kernels (linear, polynomial, radial basis function, and sigmoidal kernels formula). Although this implementation is widely used, it is not sufficiently fast to handle largescale classification or regression tasks.

To improve the performance, we have recently implemented SVMs on a graphical processing unit (GPU). GPUs are a massively parallel execution environment that provide many advantages when computing SVMs:

1st: a large number of independent threads build a highly parallel and fast computational engine;

2nd: using GPU Basic Linear Algebra Subroutines (CUBLAS) instead of conventional Intel Math Kernel Library (MKL) can speed up the application 3 to 5 times;

3rd: kernel functions called for the huge samples will be more efficient on SIMD (Single Instruction Multiple Data) computer.

GPU tools dedicated to SVMs have recently been developed and provide command line interface and binary classification, which functions are comparable to the e1071 package. Among these SVM programs, GT SVM ( Cotter, Srebro, and Keshet 2011) takes full advantage of GPU architecture and efficiently handles sparse datasets through the use of a clustering technique. GT SVM is also implemented in C/C++ and provides simple functions that can make use of the package as a library. To enable the use of GT SVM without expertise in C/ C++, we implemented an R interface to GT SVM that combines the easeofuse of e1071 and the speed of the GT SVM GPU implementation. Our implementation consists of the following:

  1. an R wrapper for GT SVM,
  1. matching the SVM interface in the e1071 package so that R written around each implementation is exchangeable,
  1. adding or altering some features in R code, such as cross-validation which is implemented in C/C++ in e1071 and has not been implemented in GT SVM.
  1. Supporting prediction using multiple GPU cards on single host for further speedup computation.

Functions:

Firstly our implementation is encapsulated in one R package which is backwardscompatible with the e1071 implementation.

The package has the following features:

  1. Binary classification, multiclass classification and epsilon regression
  1. 4 kernel functions (linear, polynomial, radial basis function and sigmoidal kernel)
  1. K-fold cross validation
  1. Tuning parameters in kernel function or in SVM primary space or dual space (C, e).
  1. Big matrix used in training or predicting data
  1. Altering cost values for minor class or major class.

Usage instructions

Rgtsvm implement the following functions on GPU package(GTSVM)

svm: a function to train a support vector machine by the C-classfication method and epsilon regression on GPU

predict: a function to predict values based upon a model trained by svm in package Rgtsvm

tune: a function to tune hyperparameters of statistical methods using a grid search over supplied parameter ranges

plot.tune: visualizes the results of parameter tuning

load.svmlight: a function to load SVMlight data file into a sparse matrix

Please check the details in the manual (https://github.com/Danko-Lab/Rgtsvm/blob/master/Rgtsvm-manual.pdf) or the vignette (https://github.com/Danko-Lab/Rgtsvm/blob/master/Rgtsvm-vignette.pdf).

To use Rgtsvm, type:

> library(Rgtsvm);

> ?svm

> model <- svm(Species ~ ., data = iris);

Performance

Image of comparison with e1071 and Rgtsvm

Image of comparison with e1071 and Rgtsvm

Installation Instructions:

Rgtsvm is only available for the Linux and Mac OSX. The source code can be downloaded from this repository (https://github.com/Danko-Lab/Rgtsvm.git).

Required software and packages

  1. R (http://www.r-project.org/)

  2. CUDA library (https://developer.nvidia.com/cuda-toolkit-archive).

  3. Boost library (http://www.boost.org/users/download/)

  4. Extra R Package: bit64, snow, SparseM, Matrix

Install Rgtsvm

Please install the required R package before you install Rgtsvm package. After the installation of bit64, snow, SparseM and Matrix package, please install the Rgtsvm as following steps.


# Set $YOUR_CUDA_HOME and $YOUR_BOOST_HOME before installation

$ git clone https://github.com/Danko-Lab/Rgtsvm.git

$ cd Rgtsvm

$ make R_dependencies

$ R CMD INSTALL --configure-args="--with-cuda-home=$YOUR_CUDA_HOME --with-boost-home=$YOUR_BOOST_HOME" Rgtsvm

If you have installed the pakacge devtools, you can try these commands in R console:

> library(devtools)
> install_github("Danko-lab/Rgtsvm/Rgtsvm", args="--configure-args='--with-cuda-home=YOUR_CUDA_PATH --with-boost-home=YOU_BOOST_PATH'" )

Please check the vignette (https://github.com/Danko-Lab/Rgtsvm/blob/master/Rgtsvm-vignette.pdf) to see more details.

Specify CUDA arch on CUDA 7 and later

If you get the following errors for a simple training example, maybe you need to conside the NVIDIA GPU type when you install Rgtsvm.

> library(Rgtsvm)
> svm_iris<- Rgtsvm::svm(Species ~ ., data=iris)
 Error: SparseKernelFindLargestScore: did not find the desired number of maxima[1]
 Error in gtsvmtrain.classfication.call(y, x, param, verbose = verbose) : Error in GPU process.

CUDA 7.0 and later supports multiple NVIDIA GPU architectures that the CUDA files will be compiled for. http://arnon.dk/matching-sm-architectures-arch-and-gencode-for-various-nvidia-cards/

As described in above link, you should select one architecture type, such as sm_50 for TitanX or sm_60 for P100, sm_35 for Tesla K40. And then set the architecture in your install command using the option --with-cuda-arch.

> library(devtools)
> install_github("Danko-lab/Rgtsvm/Rgtsvm", args="--configure-args='--with-cuda-arch=sm_35 --with-cuda-home=YOUR_CUDA_PATH --with-boost-home=YOU_BOOST_PATH'" )

Or

 R CMD INSTALL --configure-args="-with-cuda-arch=sm_35 --with-cuda-home=YOUR_CUDA_PATH --with-boost-home=YOU_BOOST_PATH" Rgtsvm

Installation Example

Installation instructions on stampede.tacc.xsede.org

module load gcc/4.7.1
module load cuda
module load boost/1.55.0

R CMD INSTALL --configure-args="--with-cuda-home=/opt/apps/cuda/6.5 --with-boost-home=/opt/apps/gcc4_7/boost/1.55.0" Rgtsvm

Installation instructions on supermic.cct-lsu.xsede.org

module load r
module load cuda/6.5
R CMD INSTALL --configure-args="--with-cuda-home=/usr/local/packages/cuda/6.5 --with-boost-home=/usr/local/packages/boost/1.55.0/INTEL-14.0.2-python-2.7.7-anaconda" Rgtsvm

License (GPLv3)

Copyright(c) 2017 Zhong Wang

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 3 of the License, or 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, see http://www.gnu.org/licenses/.

How to cite

Wang, Z., Chu, T., Choate, L. A., & Danko, C. G. (2017). Rgtsvm: Support Vector Machines on a GPU in R. arXiv preprint arXiv:1706.05544.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].