![]() |
PLSSVM - Parallel Least Squares Support Vector Machine
2.0.0
A Least Squares Support Vector Machine implementation using different backends.
|
The main namespace containing all public API functions. More...
Namespaces | |
| cuda | |
| Namespace containing the C-SVM using the CUDA backend. | |
| detail | |
| Namespace containing implementation details. Should not directly be used by users. | |
| dpcpp | |
| Namespace containing the C-SVM using the SYCL backend with DPC++ as SYCL implementation. | |
| hip | |
| Namespace containing the C-SVM using the HIP backend. | |
| hipsycl | |
| Namespace containing the C-SVM using the SYCL backend with hipSYCL as SYCL implementation. | |
| opencl | |
| Namespace containing the C-SVM using the OpenCL backend. | |
| openmp | |
| Namespace containing the C-SVM using the OpenMP backend. | |
| operators | |
| Namespace containing operator overloads for std::vector and other mathematical functions on vectors. | |
| sycl | |
| Namespace containing the C-SVM using the SYCL backend with the preferred SYCL implementation. | |
| version | |
| Namespace containing versioning information. | |
Classes | |
| struct | csvm_to_backend_type |
Get the plssvm::backend_type of the C-SVM class of type T. Ignores all top-level const, volatile, and reference qualifiers. More... | |
| class | csvm |
| Base class for all C-SVM backends. More... | |
| struct | csvm_backend_exists |
Sets the value of the value member to true if T is a C-SVM using an available backend. Ignores any top-level const, volatile, and reference qualifiers. More... | |
| class | data_set |
| Encapsulate all necessary data that is needed for training or predicting using an SVM. More... | |
| struct | default_init |
This class denotes an explicit default value initialization used to distinguish between the default value or user provided initialization in the default_value class. More... | |
| class | default_value |
| This class encapsulates a value that may be a default value or not. More... | |
| struct | is_default_value |
Test whether the given type T is of type plssvm::default_value ignoring all top-level const, volatile, and reference qualifiers. More... | |
| class | exception |
Base class for all custom exception types. Forwards its message to std::runtime_error and saves the exception name and the call side source location information. More... | |
| class | invalid_parameter_exception |
| Exception type thrown if the provided parameter is invalid. More... | |
| class | file_reader_exception |
| Exception type thrown if the file_reader is used inappropriately (e.g., if two files should be opened at the same time). More... | |
| class | data_set_exception |
| Exception type thrown if a data_set is used inappropriately. More... | |
| class | file_not_found_exception |
| Exception type thrown if the provided file couldn't be found. More... | |
| class | invalid_file_format_exception |
| Exception type thrown if the provided file has an invalid format for the selected parser (e.g. if the arff parser tries to parse a LIBSVM file). More... | |
| class | unsupported_backend_exception |
| Exception type thrown if the requested backend is not supported on the target machine. More... | |
| class | unsupported_kernel_type_exception |
| Exception type thrown if the requested kernel type is not supported. More... | |
| class | gpu_device_ptr_exception |
| Exception type thrown if an error in the generic plssvm::detail::gpu_device_ptr occurred. More... | |
| class | source_location |
| The plssvm::source_location class represents certain information about the source code, such as file names, line numbers, or function names. More... | |
| class | model |
| Implements a class encapsulating the result of a call to the SVM fit function. A model is used to predict the labels of a new data set. More... | |
Typedefs | |
| using | kernel_index_type = int |
| Integer type used inside kernels. | |
| template<typename T > | |
| using | optional_ref = std::optional< std::reference_wrapper< T > > |
Type alias for an optional reference (since std::optional<T&> is not allowed). More... | |
| using | parameter = detail::parameter< double > |
The public parameter type uses double to store the SVM parameters. | |
Enumerations | |
| enum class | backend_type { automatic , openmp , cuda , hip , opencl , sycl } |
| Enum class for all possible backend types. More... | |
| enum class | verbosity_level { quiet = 0b000 , libsvm = 0b001 , timing = 0b010 , full = 0b100 } |
| Enum class for all possible verbosity levels. More... | |
| enum class | file_format_type { libsvm , arff } |
| Enum class for all supported file types. More... | |
| enum class | kernel_function_type { linear = 0 , polynomial = 1 , rbf = 2 } |
| Enum class for all implemented kernel functions. More... | |
| enum class | target_platform { automatic , cpu , gpu_nvidia , gpu_amd , gpu_intel } |
| Enum class for all possible targets. More... | |
Functions | |
| std::vector< backend_type > | list_available_backends () |
| Return a list of all currently available backends. More... | |
| backend_type | determine_default_backend (const std::vector< backend_type > &available_backends=list_available_backends(), const std::vector< target_platform > &available_target_platforms=list_available_target_platforms()) |
| Returns the default backend (if plssvm::backend_type::automatic is used) given the backend and target platform lists. More... | |
| std::ostream & | operator<< (std::ostream &out, backend_type backend) |
Output the backend to the given output-stream out. More... | |
| std::istream & | operator>> (std::istream &in, backend_type &backend) |
Use the input-stream in to initialize the backend type. More... | |
| template<typename... Args> | |
| 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. More... | |
| template<typename... Args> | |
| std::unique_ptr< csvm > | make_csvm (Args &&...args) |
Create a new C-SVM using the automatic backend type and the additional parameter args. More... | |
| template<typename T > | |
| std::ostream & | operator<< (std::ostream &out, const default_value< T > &val) |
Output the wrapped value of val to the given output-stream out. More... | |
| template<typename T > | |
| std::istream & | operator>> (std::istream &in, default_value< T > &val) |
Use the input-stream in to initialize the default_value val. More... | |
| template<typename T > | |
| constexpr void | swap (default_value< T > &lhs, default_value< T > &rhs) noexcept(noexcept(lhs.swap(rhs))) |
Swap the content of two default_values lhs and rhs. More... | |
| template<typename T > | |
| constexpr bool | operator== (const default_value< T > &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values lhs and rhs for equality. More... | |
| template<typename T > | |
| constexpr bool | operator== (const default_value< T > &lhs, const T &rhs) noexcept |
Compares the two active values lhs and rhs for equality. More... | |
| template<typename T > | |
| constexpr bool | operator== (const T &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values lhs and rhs for equality. More... | |
| template<typename T > | |
| constexpr bool | operator!= (const default_value< T > &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values lhs and rhs for inequality. More... | |
| template<typename T > | |
| constexpr bool | operator!= (const default_value< T > &lhs, const T &rhs) noexcept |
Compares the two active values lhs and rhs for inequality. More... | |
| template<typename T > | |
| constexpr bool | operator!= (const T &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values lhs and rhs for inequality. More... | |
| template<typename T > | |
| constexpr bool | operator< (const default_value< T > &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values: lhs < rhs. More... | |
| template<typename T > | |
| constexpr bool | operator< (const default_value< T > &lhs, const T &rhs) noexcept |
Compares the two active values: lhs < rhs. More... | |
| template<typename T > | |
| constexpr bool | operator< (const T &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values: lhs < rhs. More... | |
| template<typename T > | |
| constexpr bool | operator> (const default_value< T > &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values: lhs > rhs. More... | |
| template<typename T > | |
| constexpr bool | operator> (const default_value< T > &lhs, const T &rhs) noexcept |
Compares the two active values: lhs > rhs. More... | |
| template<typename T > | |
| constexpr bool | operator> (const T &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values: lhs > rhs. More... | |
| template<typename T > | |
| constexpr bool | operator<= (const default_value< T > &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values: lhs <= rhs. More... | |
| template<typename T > | |
| constexpr bool | operator<= (const default_value< T > &lhs, const T &rhs) noexcept |
Compares the two active values: lhs <= rhs. More... | |
| template<typename T > | |
| constexpr bool | operator<= (const T &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values: lhs <= rhs. More... | |
| template<typename T > | |
| constexpr bool | operator>= (const default_value< T > &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values: lhs >= rhs. More... | |
| template<typename T > | |
| constexpr bool | operator>= (const default_value< T > &lhs, const T &rhs) noexcept |
Compares the two active values: lhs >= rhs. More... | |
| template<typename T > | |
| constexpr bool | operator>= (const T &lhs, const default_value< T > &rhs) noexcept |
Compares the two active values: lhs >= rhs. More... | |
| std::ostream & | operator<< (std::ostream &out, verbosity_level verb) |
Output the verb to the given output-stream out. More... | |
| std::istream & | operator>> (std::istream &in, verbosity_level &verb) |
Use the input-stream in to initialize the verb level. More... | |
| verbosity_level | operator| (verbosity_level lhs, verbosity_level rhs) |
| Bitwise-or to set multiple verbosity levels at once for a logging message. More... | |
| verbosity_level | operator|= (verbosity_level &lhs, verbosity_level rhs) |
| Bitwise-or to set multiple verbosity levels at once for a logging message. More... | |
| verbosity_level | operator& (verbosity_level lhs, verbosity_level rhs) |
| Bitwise-and to check verbosity levels for a logging message. More... | |
| verbosity_level | operator&= (verbosity_level &lhs, verbosity_level rhs) |
| Bitwise-and to check verbosity levels for a logging message. More... | |
| std::ostream & | operator<< (std::ostream &out, file_format_type format) |
Output the format to the given output-stream out. More... | |
| std::istream & | operator>> (std::istream &in, file_format_type &format) |
Use the input-stream in to initialize the format type. More... | |
| std::ostream & | operator<< (std::ostream &out, kernel_function_type kernel) |
Output the kernel type to the given output-stream out. More... | |
| std::string_view | kernel_function_type_to_math_string (kernel_function_type kernel) noexcept |
Return the mathematical representation of the kernel_type kernel. More... | |
| std::istream & | operator>> (std::istream &in, kernel_function_type &kernel) |
Use the input-stream in to initialize the kernel type. More... | |
| template<kernel_function_type kernel, typename real_type , typename... Args> | |
| real_type | kernel_function (const std::vector< real_type > &xi, const std::vector< real_type > &xj, Args &&...args) |
Computes the value of the two vectors xi and xj using the kernel function determined at compile-time. More... | |
| template<typename real_type > | |
| real_type | kernel_function (const std::vector< real_type > &xi, const std::vector< real_type > &xj, const detail::parameter< real_type > ¶ms) |
Computes the value of the two vectors xi and xj using the kernel function and kernel parameter stored in params. More... | |
| constexpr bool | equivalent (const parameter &lhs, const parameter &rhs) noexcept |
Checks whether the two parameter sets lhs and rhs are equivalent. More... | |
| std::vector< target_platform > | list_available_target_platforms () |
| Return a list of all currently available target platforms. More... | |
| target_platform | determine_default_target_platform (const std::vector< target_platform > &platform_device_list=list_available_target_platforms()) |
Return the default target platform given the available devices in platform_device_list. More... | |
| std::ostream & | operator<< (std::ostream &out, target_platform target) |
Output the target platform to the given output-stream out. More... | |
| std::istream & | operator>> (std::istream &in, target_platform &target) |
Use the input-stream in to initialize the target platform. More... | |
Variables | |
| template<typename T > | |
| constexpr backend_type | csvm_to_backend_type_v = csvm_to_backend_type<T>::value |
Get the plssvm::backend_type of the C-SVM class of type T. Ignores all top-level const, volatile, and reference qualifiers. More... | |
| constexpr kernel_index_type | THREAD_BLOCK_SIZE = 16 |
| Global compile-time constant used for internal caching. May be changed during the CMake configuration step. | |
| constexpr kernel_index_type | INTERNAL_BLOCK_SIZE = 6 |
| Global compile-time constant used for internal caching. May be changed during the CMake configuration step. | |
| constexpr kernel_index_type | OPENMP_BLOCK_SIZE = 64 |
| Global compile-time constant used for internal caching in the OpenMP kernel. May be changed during the CMake configuration step. | |
| template<typename T > | |
| constexpr bool | csvm_backend_exists_v = csvm_backend_exists<T>::value |
Sets the value of the value member to true if T is a C-SVM using an available backend. Ignores any top-level const, volatile, and reference qualifiers. | |
| template<typename T > | |
| constexpr bool | is_default_value_v = is_default_value<T>::value |
Test whether the given type T is of type plssvm::default_value ignoring all top-level const, volatile, and reference qualifiers. | |
| verbosity_level | verbosity |
| The verbosity level used in the logging function. My be changed by the user. | |
The main namespace containing all public API functions.
| using plssvm::optional_ref = typedef std::optional<std::reference_wrapper<T> > |
Type alias for an optional reference (since std::optional<T&> is not allowed).
| T | the type to wrap as a reference |
|
strong |
Enum class for all possible backend types.
| Enumerator | |
|---|---|
| automatic | The default backend. Depends on the specified target platform. |
| openmp | OpenMP to target CPUs only (currently no OpenMP target offloading support). |
| cuda | CUDA to target NVIDIA GPUs only. |
| hip | HIP to target AMD and NVIDIA GPUs. |
| opencl | OpenCL to target CPUs and GPUs from different vendors. |
| sycl | SYCL to target CPUs and GPUs from different vendors. Currently tested SYCL implementations are DPC++ and hipSYCL. |
|
strong |
|
strong |
Enum class for all supported file types.
| Enumerator | |
|---|---|
| libsvm | The LIBSVM file format. Used as default. For the file format specification see: https://www.csie.ntu.edu.tw/~cjlin/libsvm/faq.html |
| arff | The ARFF file format. For the file format specification see: https://www.cs.waikato.ac.nz/~ml/weka/arff.html |
|
strong |
|
strong |
Enum class for all possible targets.
| std::vector<backend_type> plssvm::list_available_backends | ( | ) |
Return a list of all currently available backends.
Only backends that where found during the CMake configuration are available.
[[nodiscard]]) | backend_type plssvm::determine_default_backend | ( | const std::vector< backend_type > & | available_backends = list_available_backends(), |
| const std::vector< target_platform > & | available_target_platforms = list_available_target_platforms() |
||
| ) |
Returns the default backend (if plssvm::backend_type::automatic is used) given the backend and target platform lists.
| [in] | available_backends | list of backends; if no backends are provided, queries all available backends |
| [in] | available_target_platforms | list of target platforms; if no target platforms are provided, queries all available target platforms |
[[nodiscard]]) | std::ostream& plssvm::operator<< | ( | std::ostream & | out, |
| backend_type | backend | ||
| ) |
Output the backend to the given output-stream out.
| [in,out] | out | the output-stream to write the backend type to |
| [in] | backend | the backend type |
| std::istream& plssvm::operator>> | ( | std::istream & | in, |
| backend_type & | backend | ||
| ) |
Use the input-stream in to initialize the backend type.
| [in,out] | in | input-stream to extract the backend type from |
| [in] | backend | the backend type |
|
inline |
Create a new C-SVM using the backend type and additional parameter args.
| Args | the types of the parameters to initialize the C-SVM |
| [in] | backend | the backend to use |
| [in] | args | the parameters used to initialize the respective C-SVM |
| plssvm::unsupported_backend_exception | if the backend is not recognized |
[[nodiscard]])
|
inline |
Create a new C-SVM using the automatic backend type and the additional parameter args.
| Args | the types of the parameters to initialize the C-SVM |
| [in] | args | the parameters used to initialize the respective C-SVM |
| plssvm::unsupported_backend_exception | if the backend is not recognized |
[[nodiscard]])
|
inline |
Output the wrapped value of val to the given output-stream out.
| T | the type of the wrapped value |
| [in,out] | out | the output-stream to write the wrapped default_value value to |
| [in] | val | the default_value |
|
inline |
Use the input-stream in to initialize the default_value val.
Sets the user defined value, i.e., plssvm::default_value::is_default() will return false and the default value will not be used.
| T | the type of the wrapped value |
| [in,out] | in | input-stream to extract the wrapped default_value value from |
| [in] | val | the default_value |
|
constexprnoexcept |
Swap the content of two default_values lhs and rhs.
| [in,out] | lhs | the first default_value |
| [in,out] | rhs | the second default_value |
|
constexprnoexcept |
Compares the two active values lhs and rhs for equality.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values are equal, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values lhs and rhs for equality.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values are equal, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values lhs and rhs for equality.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values are equal, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values lhs and rhs for inequality.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values are unequal, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values lhs and rhs for inequality.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values are unequal, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values lhs and rhs for inequality.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values are unequal, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs < rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is less than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs < rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is less than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs < rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is less than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs > rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is greater than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs > rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is greater than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs > rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is greater than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs <= rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is less or equal than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs <= rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is less or equal than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs <= rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is less or equal than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs >= rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is greater or equal than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs >= rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is greater or equal than the active value of rhs, false otherwise ([[nodiscard]])
|
constexprnoexcept |
Compares the two active values: lhs >= rhs.
| T | the type of the wrapped value |
| [in] | lhs | the first default_value |
| [in] | rhs | the second default_value |
true if the active values of lhs is greater or equal than the active value of rhs, false otherwise ([[nodiscard]]) | std::ostream& plssvm::operator<< | ( | std::ostream & | out, |
| verbosity_level | verb | ||
| ) |
Output the verb to the given output-stream out.
If more than one verbosity level is provided, outputs all of them, e.g., "libsvm | timing".
| [in,out] | out | the output-stream to write the verbosity level to |
| [in] | verb | the verbosity level |
| std::istream& plssvm::operator>> | ( | std::istream & | in, |
| verbosity_level & | verb | ||
| ) |
Use the input-stream in to initialize the verb level.
If more than one verbosity level is provided, e.g., "libsvm | timing" returns a bitwise-or of the respective enum values. If any of the values is "quiet", the result will always be plssvm::verbosity_level::quiet.
| [in,out] | in | input-stream to extract the verbosity level from |
| [in] | verb | the verbosity level |
| verbosity_level plssvm::operator| | ( | verbosity_level | lhs, |
| verbosity_level | rhs | ||
| ) |
Bitwise-or to set multiple verbosity levels at once for a logging message.
| [in] | lhs | the first verbosity level |
| [in] | rhs | the second verbosity level |
[[nodiscard]]) | verbosity_level plssvm::operator|= | ( | verbosity_level & | lhs, |
| verbosity_level | rhs | ||
| ) |
Bitwise-or to set multiple verbosity levels at once for a logging message.
| [in] | lhs | the first verbosity level |
| [in] | rhs | the second verbosity level |
| verbosity_level plssvm::operator& | ( | verbosity_level | lhs, |
| verbosity_level | rhs | ||
| ) |
Bitwise-and to check verbosity levels for a logging message.
| [in] | lhs | the first verbosity level |
| [in] | rhs | the second verbosity level |
[[nodiscard]]) | verbosity_level plssvm::operator&= | ( | verbosity_level & | lhs, |
| verbosity_level | rhs | ||
| ) |
Bitwise-and to check verbosity levels for a logging message.
| [in] | lhs | the first verbosity level |
| [in] | rhs | the second verbosity level |
| std::ostream& plssvm::operator<< | ( | std::ostream & | out, |
| file_format_type | format | ||
| ) |
Output the format to the given output-stream out.
| [in,out] | out | the output-stream to write the file format type to |
| [in] | format | the file format type |
| std::istream& plssvm::operator>> | ( | std::istream & | in, |
| file_format_type & | format | ||
| ) |
Use the input-stream in to initialize the format type.
| [in,out] | in | input-stream to extract the file format type from |
| [in] | format | the file format type |
| std::ostream& plssvm::operator<< | ( | std::ostream & | out, |
| kernel_function_type | kernel | ||
| ) |
Output the kernel type to the given output-stream out.
| [in,out] | out | the output-stream to write the kernel type to |
| [in] | kernel | the kernel type |
|
noexcept |
Return the mathematical representation of the kernel_type kernel.
Uses placeholders for the scalar values and vectors.
| [in] | kernel | the kernel type |
kernel ([[nodiscard]]) | std::istream& plssvm::operator>> | ( | std::istream & | in, |
| kernel_function_type & | kernel | ||
| ) |
Use the input-stream in to initialize the kernel type.
The extracted value is matched case-insensitive and can be the integer value of the kernel_type.
| [in,out] | in | input-stream to extract the kernel type from |
| [in] | kernel | the kernel type |
|
inline |
Computes the value of the two vectors xi and xj using the kernel function determined at compile-time.
| kernel | the type of the kernel |
| real_type | the type of the values |
| Args | additional parameters used in the respective kernel function |
| [in] | xi | the first vector |
| [in] | xj | the second vector |
| [in] | args | additional parameters |
kernel function ([[nodiscard]]) | real_type plssvm::kernel_function | ( | const std::vector< real_type > & | xi, |
| const std::vector< real_type > & | xj, | ||
| const detail::parameter< real_type > & | params | ||
| ) |
Computes the value of the two vectors xi and xj using the kernel function and kernel parameter stored in params.
| real_type | the type of the values |
| [in] | xi | the first vector |
| [in] | xj | the second vector |
| [in] | params | class encapsulating the kernel type and kernel parameters |
| plssvm::unsupported_kernel_type_exception | if the kernel function in params is not supported |
[[nodiscard]])
|
constexprnoexcept |
Checks whether the two parameter sets lhs and rhs are equivalent.
Compares the member variables based on the kernel, i.e., for example for the rbf kernel both parameter sets must only have the same gamma and cost values but may differ in the values of degree or coef0. If all members should be compared regardless of the kernel type, one can use the operator== overload.
| [in] | lhs | the first parameter set |
| [in] | rhs | the second parameter set |
true if both parameter sets are equivalent, false otherwise ([[nodiscard]]) | std::vector<target_platform> plssvm::list_available_target_platforms | ( | ) |
Return a list of all currently available target platforms.
Only target platforms that where requested during the CMake configuration are available.
[[nodiscard]]) | target_platform plssvm::determine_default_target_platform | ( | const std::vector< target_platform > & | platform_device_list = list_available_target_platforms() | ) |
Return the default target platform given the available devices in platform_device_list.
Does not take the currently available backends into account!
| [in] | platform_device_list | list of target_platforms found in the current setup; if no target_platforms are provided, queries all available target_platforms |
[[nodiscard]]) | std::ostream& plssvm::operator<< | ( | std::ostream & | out, |
| target_platform | target | ||
| ) |
Output the target platform to the given output-stream out.
| [in,out] | out | the output-stream to write the target platform to |
| [in] | target | the target platform |
| std::istream& plssvm::operator>> | ( | std::istream & | in, |
| target_platform & | target | ||
| ) |
Use the input-stream in to initialize the target platform.
| [in,out] | in | input-stream to extract the target platform from |
| [in] | target | the target platform |
|
constexpr |
Get the plssvm::backend_type of the C-SVM class of type T. Ignores all top-level const, volatile, and reference qualifiers.
Provides a member variable value if T is a valid C-SVM. If T is a SYCL C-SVM, an additional member variable impl is provided showing the used SYCL implementation.
| T | the type of the C-SVM to get the backend type from |
A shorthand for plssvm::csvm_to_backend_type::value.