Class Kernel¶
Defined in File Kernel.h
Inheritance Relationships¶
Derived Types¶
public KernelWrapper(Class KernelWrapper)public PyKernel(Class PyKernel)public RBFKernel(Class RBFKernel)
Class Documentation¶
-
class Kernel¶
Virtual base class for Kernels. Usually, I would try to make this a little easier / more accessible and use raw function pointer / std::function for kernels. However, sometimes kernels have parameters or may hold a state. Thus I decided to use (simple) classes. To circumvent writing new classes for each kernel, you can use the KernelWrapper to wrap functions / lambdas into this object.
Subclassed by KernelWrapper, PyKernel, RBFKernel
Public Functions
-
inline virtual data_t operator()(const std::vector<data_t> &x1, const std::vector<data_t> &x2) const = 0¶
Evaluates the kernel on the two given parameters x1, x2.
- Parameters
x1 – The first parameter of the kernel.
x2 – The second parameter of the kernel.
-
virtual std::shared_ptr<Kernel> clone() const = 0¶
Clones the current kernel object and returns a shared pointer to the copy.
Note
Clones should be a deep copy of the object, because a SubmodularOptimizer might generate multiple copies of this kernel if required.
-
inline virtual ~Kernel()¶
Destroys the current kernel.
-
inline virtual data_t operator()(const std::vector<data_t> &x1, const std::vector<data_t> &x2) const = 0¶