SVM training library using GPU optimized hierarchy decomposition algorithm.
CMake version 3.1 or higher is used to generate makefiles or Visual studio project files. The library is written in C++ and requires compiler with C++11 support. The only dependency is NVIDIA CUDA.
This project is not an executable application, it is a library exporting a function to train SVM model and must be linked with and called from a user application. Alternatively user can use SVMbenchmark application to train SVM model using this library as is described at the end of this readme.
Application has to include header file ohdSVM.h
.
All library functions and data types are in namespace ohdSVM
.
Training data must be stored in union ohdSVM::Data
.
union ohdSVM::Data
{
const float * dense;
const ohdSVM::csr * sparse;
}
Its member variable dense
points to a linearized row major matrix of input data where each row is one training vector.
Rows offsets must be aligned to multiple of 32 floats.
Member variable parse
points to an input data in CSR representation. Look at ohdSVM::csr
structure definition for more details.
The function to perform training is ohdSVM::Train
.
bool ohdSVM::Train(float * alpha,
float * rho,
bool sparse,
const Data & x,
const float * y,
size_t num_vec,
size_t num_vec_aligned,
size_t dim,
size_t dim_aligned,
float C,
float gamma,
float eps,
int ws_size = 0)
This function returns true if training succeeds. Otherwise output variables are unchanged.
SVMbenchmark is an application which can be used to traing SVM model using several SVM training implementations. OHD-SVM is one of the supported implementations. To use OHD-SVM with SVMbenchmark, do these steps:
SVMbenchmark/OHD-SVM
.-i 16
). Please check SVMbenchmark readme for information how to execute the application.