PLSSVM - Parallel Least Squares Support Vector Machine  2.0.0
A Least Squares Support Vector Machine implementation using different backends.
Namespaces | Classes | Functions
plssvm::cuda Namespace Reference

Namespace containing the C-SVM using the CUDA backend. More...

Namespaces

 detail
 Namespace containing CUDA backend specific implementation details. Should not directly be used by users.
 

Classes

class  csvm
 A C-SVM implementation using CUDA as backend. More...
 
class  backend_exception
 Exception type thrown if a problem with the CUDA backend occurs. More...
 

Functions

template<typename real_type >
__global__ void device_kernel_w_linear (real_type *w_d, const real_type *data_d, const real_type *data_last_d, const real_type *alpha_d, const kernel_index_type num_data_points, const kernel_index_type num_features)
 Calculate the w vector to speed up the prediction of the labels for data points using the linear kernel function. More...
 
template<typename real_type >
__global__ void device_kernel_predict_polynomial (real_type *out_d, const real_type *data_d, const real_type *data_last_d, const real_type *alpha_d, const kernel_index_type num_data_points, const real_type *points, const kernel_index_type num_predict_points, const kernel_index_type num_features, const int degree, const real_type gamma, const real_type coef0)
 Predicts the labels for data points using the polynomial kernel function. More...
 
template<typename real_type >
__global__ void device_kernel_predict_rbf (real_type *out_d, const real_type *data_d, const real_type *data_last_d, const real_type *alpha_d, const kernel_index_type num_data_points, const real_type *points, const kernel_index_type num_predict_points, const kernel_index_type num_features, const real_type gamma)
 Predicts the labels for data points using the radial basis functions kernel function. More...
 
template<typename real_type >
__global__ void device_kernel_q_linear (real_type *q, const real_type *data_d, const real_type *data_last, const kernel_index_type num_rows, const kernel_index_type feature_range)
 Calculates the q vector using the linear C-SVM kernel. More...
 
template<typename real_type >
__global__ void device_kernel_q_polynomial (real_type *q, const real_type *data_d, const real_type *data_last, const kernel_index_type num_rows, const kernel_index_type num_cols, const int degree, const real_type gamma, const real_type coef0)
 Calculates the q vector using the polynomial C-SVM kernel. More...
 
template<typename real_type >
__global__ void device_kernel_q_rbf (real_type *q, const real_type *data_d, const real_type *data_last, const kernel_index_type num_rows, const kernel_index_type num_cols, const real_type gamma)
 Calculates the q vector using the radial basis functions C-SVM kernel. More...
 
template<typename real_type >
__global__ void device_kernel_linear (const real_type *q, real_type *ret, const real_type *d, const real_type *data_d, const real_type QA_cost, const real_type cost, const kernel_index_type num_rows, const kernel_index_type feature_range, const real_type add, const kernel_index_type id)
 Calculates the C-SVM kernel using the linear kernel function. More...
 
template<typename real_type >
__global__ void device_kernel_polynomial (const real_type *q, real_type *ret, const real_type *d, const real_type *data_d, const real_type QA_cost, const real_type cost, const kernel_index_type num_rows, const kernel_index_type num_cols, const real_type add, const int degree, const real_type gamma, const real_type coef0)
 Calculates the C-SVM kernel using the polynomial kernel function. More...
 
template<typename real_type >
__global__ void device_kernel_rbf (const real_type *q, real_type *ret, const real_type *d, const real_type *data_d, const real_type QA_cost, const real_type cost, const kernel_index_type num_rows, const kernel_index_type num_cols, const real_type add, const real_type gamma)
 Calculates the C-SVM kernel using the radial basis function kernel function. More...
 

Detailed Description

Namespace containing the C-SVM using the CUDA backend.

Function Documentation

◆ device_kernel_w_linear()

template<typename real_type >
__global__ void plssvm::cuda::device_kernel_w_linear ( real_type *  w_d,
const real_type *  data_d,
const real_type *  data_last_d,
const real_type *  alpha_d,
const kernel_index_type  num_data_points,
const kernel_index_type  num_features 
)

Calculate the w vector to speed up the prediction of the labels for data points using the linear kernel function.

Supports multi-GPU execution.

Template Parameters
real_typethe type of the data
Parameters
[out]w_dthe w vector to assemble
[in]data_dthe one-dimension support vector matrix
[in]data_last_dthe last row of the support vector matrix
[in]alpha_dthe previously calculated weight for each data point
[in]num_data_pointsthe total number of support vectors
[in]num_featuresthe number of features per support vector

◆ device_kernel_predict_polynomial()

template<typename real_type >
__global__ void plssvm::cuda::device_kernel_predict_polynomial ( real_type *  out_d,
const real_type *  data_d,
const real_type *  data_last_d,
const real_type *  alpha_d,
const kernel_index_type  num_data_points,
const real_type *  points,
const kernel_index_type  num_predict_points,
const kernel_index_type  num_features,
const int  degree,
const real_type  gamma,
const real_type  coef0 
)

Predicts the labels for data points using the polynomial kernel function.

Currently only single GPU execution is supported.

Template Parameters
real_typethe type of the data
Parameters
[out]out_dthe calculated predictions
[in]data_dthe one-dimension support vector matrix
[in]data_last_dthe last row of the support vector matrix
[in]alpha_dthe previously calculated weight for each data point
[in]num_data_pointsthe total number of support vectors
[in]pointsthe data points to predict
[in]num_predict_pointsthe total number of data points to predict
[in]num_featuresthe number of features per support vector and point to predict
[in]degreethe degree parameter used in the polynomial kernel function
[in]gammathe gamma parameter used in the polynomial kernel function
[in]coef0the coef0 parameter used in the polynomial kernel function

◆ device_kernel_predict_rbf()

template<typename real_type >
__global__ void plssvm::cuda::device_kernel_predict_rbf ( real_type *  out_d,
const real_type *  data_d,
const real_type *  data_last_d,
const real_type *  alpha_d,
const kernel_index_type  num_data_points,
const real_type *  points,
const kernel_index_type  num_predict_points,
const kernel_index_type  num_features,
const real_type  gamma 
)

Predicts the labels for data points using the radial basis functions kernel function.

Currently only single GPU execution is supported.

Template Parameters
real_typethe type of the data
Parameters
[out]out_dthe calculated predictions
[in]data_dthe one-dimension support vector matrix
[in]data_last_dthe last row of the support vector matrix
[in]alpha_dthe previously calculated weight for each data point
[in]num_data_pointsthe total number of support vectors
[in]pointsthe data points to predict
[in]num_predict_pointsthe total number of data points to predict
[in]num_featuresthe number of features per support vector and point to predict
[in]gammathe gamma parameter used in the rbf kernel function

◆ device_kernel_q_linear()

template<typename real_type >
__global__ void plssvm::cuda::device_kernel_q_linear ( real_type *  q,
const real_type *  data_d,
const real_type *  data_last,
const kernel_index_type  num_rows,
const kernel_index_type  feature_range 
)

Calculates the q vector using the linear C-SVM kernel.

Supports multi-GPU execution.

Template Parameters
real_typethe type of the data
Parameters
[out]qthe calculated q vector
[in]data_dthe one-dimensional data matrix
[in]data_lastthe last row in the data matrix
[in]num_rowsthe number of rows in the data matrix
[in]feature_rangenumber of features used for the calculation

◆ device_kernel_q_polynomial()

template<typename real_type >
__global__ void plssvm::cuda::device_kernel_q_polynomial ( real_type *  q,
const real_type *  data_d,
const real_type *  data_last,
const kernel_index_type  num_rows,
const kernel_index_type  num_cols,
const int  degree,
const real_type  gamma,
const real_type  coef0 
)

Calculates the q vector using the polynomial C-SVM kernel.

Currently only single GPU execution is supported.

Template Parameters
real_typethe type of the data
Parameters
[out]qthe calculated q vector
[in]data_dthe one-dimensional data matrix
[in]data_lastthe last row in the data matrix
[in]num_rowsthe number of rows in the data matrix
[in]num_colsthe number of columns in the data matrix
[in]degreethe degree parameter used in the polynomial kernel function
[in]gammathe gamma parameter used in the polynomial kernel function
[in]coef0the coef0 parameter used in the polynomial kernel function

◆ device_kernel_q_rbf()

template<typename real_type >
__global__ void plssvm::cuda::device_kernel_q_rbf ( real_type *  q,
const real_type *  data_d,
const real_type *  data_last,
const kernel_index_type  num_rows,
const kernel_index_type  num_cols,
const real_type  gamma 
)

Calculates the q vector using the radial basis functions C-SVM kernel.

Currently only single GPU execution is supported.

Template Parameters
real_typethe type of the data
Parameters
[out]qthe calculated q vector
[in]data_dthe one-dimensional data matrix
[in]data_lastthe last row in the data matrix
[in]num_rowsthe number of rows in the data matrix
[in]num_colsthe number of columns in the data matrix
[in]gammathe gamma parameter used in the rbf kernel function

◆ device_kernel_linear()

template<typename real_type >
__global__ void plssvm::cuda::device_kernel_linear ( const real_type *  q,
real_type *  ret,
const real_type *  d,
const real_type *  data_d,
const real_type  QA_cost,
const real_type  cost,
const kernel_index_type  num_rows,
const kernel_index_type  feature_range,
const real_type  add,
const kernel_index_type  id 
)

Calculates the C-SVM kernel using the linear kernel function.

Supports multi-GPU execution.

Template Parameters
real_typethe type of the data
Parameters
[in]qthe q vector
[out]retthe result vector
[in]dthe right-hand side of the equation
[in]data_dthe one-dimension data matrix
[in]QA_costthe bottom right matrix entry multiplied by cost
[in]cost1 / the cost parameter in the C-SVM
[in]num_rowsthe number of columns in the data matrix
[in]feature_rangenumber of features used for the calculation on the device id
[in]adddenotes whether the values are added or subtracted from the result vector
[in]idthe id of the current device

◆ device_kernel_polynomial()

template<typename real_type >
__global__ void plssvm::cuda::device_kernel_polynomial ( const real_type *  q,
real_type *  ret,
const real_type *  d,
const real_type *  data_d,
const real_type  QA_cost,
const real_type  cost,
const kernel_index_type  num_rows,
const kernel_index_type  num_cols,
const real_type  add,
const int  degree,
const real_type  gamma,
const real_type  coef0 
)

Calculates the C-SVM kernel using the polynomial kernel function.

Currently only single GPU execution is supported.

Template Parameters
real_typethe type of the data
Parameters
[in]qthe q vector
[out]retthe result vector
[in]dthe right-hand side of the equation
[in]data_dthe one-dimension data matrix
[in]QA_costhe bottom right matrix entry multiplied by cost
[in]cost1 / the cost parameter in the C-SVM
[in]num_rowsthe number of columns in the data matrix
[in]num_colsthe number of rows in the data matrix
[in]adddenotes whether the values are added or subtracted from the result vector
[in]degreethe degree parameter used in the polynomial kernel function
[in]gammathe gamma parameter used in the polynomial kernel function
[in]coef0the coef0 parameter used in the polynomial kernel function

◆ device_kernel_rbf()

template<typename real_type >
__global__ void plssvm::cuda::device_kernel_rbf ( const real_type *  q,
real_type *  ret,
const real_type *  d,
const real_type *  data_d,
const real_type  QA_cost,
const real_type  cost,
const kernel_index_type  num_rows,
const kernel_index_type  num_cols,
const real_type  add,
const real_type  gamma 
)

Calculates the C-SVM kernel using the radial basis function kernel function.

Currently only single GPU execution is supported.

Template Parameters
real_typethe type of the data
Parameters
[in]qthe q vector
[out]retthe result vector
[in]dthe right-hand side of the equation
[in]data_dthe one-dimension data matrix
[in]QA_costhe bottom right matrix entry multiplied by cost
[in]cost1 / the cost parameter in the C-SVM
[in]num_rowsthe number of columns in the data matrix
[in]num_colsthe number of rows in the data matrix
[in]adddenotes whether the values are added or subtracted from the result vector
[in]gammathe gamma parameter used in the rbf kernel function