PLSSVM - Parallel Least Squares Support Vector Machine
2.0.0
A Least Squares Support Vector Machine implementation using different backends.
csvm_factory_examples.cpp
A few examples regarding the
plssvm::make_csvm
function.
#include "
plssvm/core.hpp
"
int
main() {
// create a default support vector machine
// the used backend is determined by the plssvm::determine_default_backend function
const
auto
svm1 =
plssvm::make_csvm
();
// explicitly define a backend to use (using the default SVM parameters)
const
auto
svm2 =
plssvm::make_csvm
(
plssvm::backend_type::cuda
);
// for SYCL, the SYCL implementation type can/must also be specified
const
auto
svm3 =
plssvm::make_csvm
(
plssvm::backend_type::sycl
, plssvm::sycl_implementation_type =
plssvm::sycl::implementation_type::dpcpp
);
// explicitly define a backend and parameters to use
const
plssvm::parameter
params{ plssvm::kernel_type =
plssvm::kernel_function_type::rbf
, plssvm::gamma = 0.0001 };
const
auto
svm4 =
plssvm::make_csvm
(
plssvm::backend_type::openmp
, params);
// explicitly define a backend and named-parameters to use
const
auto
svm5 =
plssvm::make_csvm
(
plssvm::backend_type::opencl
, plssvm::kernel_type =
plssvm::kernel_function_type::rbf
, plssvm::gamma = 0.0001);
// explicitly define a backend, parameters, and named-parameters to use
const
auto
svm6 =
plssvm::make_csvm
(
plssvm::backend_type::sycl
, params, plssvm::degree = 6);
// Note: in this case the plssvm::parameter object must be THE FIRST parameter, i.e., the following will not compiled
// const auto svm7 = plssvm::make_csvm(plssvm::backend_type::sycl, plssvm::degree = 6, params);
return
0;
}
core.hpp
Core header including all other necessary headers.
plssvm::sycl::implementation_type::dpcpp
@ dpcpp
plssvm::make_csvm
std::unique_ptr< csvm > make_csvm(const backend_type backend, Args &&...args)
Create a new C-SVM using the backend type and additional parameter args.
Definition:
csvm_factory.hpp:158
plssvm::kernel_function_type::rbf
@ rbf
plssvm::backend_type::openmp
@ openmp
plssvm::backend_type::cuda
@ cuda
plssvm::backend_type::opencl
@ opencl
plssvm::backend_type::sycl
@ sycl
plssvm::detail::parameter< double >
Generated on Thu May 11 2023 19:11:13 for PLSSVM - Parallel Least Squares Support Vector Machine by
1.9.1