shark::PointSetKernel< InputType > Class Template Reference

Normalized version of a kernel function. More...

#include <shark/Models/Kernels/PointSetKernel.h>

+ Inheritance diagram for shark::PointSetKernel< InputType >:

Public Types

typedef base_type::BatchInputType BatchInputType
 
typedef base_type::ConstBatchInputReference ConstBatchInputReference
 
typedef base_type::ConstInputReference ConstInputReference
 
- Public Types inherited from shark::IParameterizable<>
typedef RealVector ParameterVectorType
 

Public Member Functions

 PointSetKernel (AbstractKernelFunction< InputType > *base)
 
std::string name () const
 returns the name of the object More...
 
RealVector parameterVector () const
 Return the parameter vector. More...
 
void setParameterVector (RealVector const &newParameters)
 Set the parameter vector. More...
 
std::size_t numberOfParameters () const
 Return the number of parameters. More...
 
boost::shared_ptr< StatecreateState () const
 creates the internal state of the kernel More...
 
double eval (ConstInputReference x1, ConstInputReference x2) const
 
void eval (ConstBatchInputReference const &batchX1, ConstBatchInputReference const &batchX2, RealMatrix &result, State &state) const
 
void eval (ConstBatchInputReference const &batchX1, ConstBatchInputReference const &batchX2, RealMatrix &result) const
 
void weightedParameterDerivative (ConstBatchInputReference const &batchX1, ConstBatchInputReference const &batchX2, RealMatrix const &coefficients, State const &state, RealVector &gradient) const
 
- Public Member Functions inherited from shark::INameable
virtual ~INameable ()
 
- Public Member Functions inherited from shark::IParameterizable<>
virtual ~IParameterizable ()
 
- Public Member Functions inherited from shark::ISerializable
virtual ~ISerializable ()
 Virtual d'tor. More...
 
void load (InArchive &archive, unsigned int version)
 Versioned loading of components, calls read(...). More...
 
void save (OutArchive &archive, unsigned int version) const
 Versioned storing of components, calls write(...). More...
 
 BOOST_SERIALIZATION_SPLIT_MEMBER ()
 

Protected Attributes

AbstractKernelFunction< InputType > * m_base
 kernel to normalize More...
 

Detailed Description

template<class InputType = RealVector>
class shark::PointSetKernel< InputType >

Normalized version of a kernel function.

For a positive definite kernel k, the normalized kernel

\[ \tilde k(x, y) := \frac{k(x, y)}{\sqrt{k(x, x) \cdot k(y, y)}} \]

is again a positive definite kernel function.

Definition at line 50 of file PointSetKernel.h.

Member Typedef Documentation

◆ BatchInputType

template<class InputType = RealVector>
typedef base_type::BatchInputType shark::PointSetKernel< InputType >::BatchInputType

Definition at line 67 of file PointSetKernel.h.

◆ ConstBatchInputReference

Definition at line 68 of file PointSetKernel.h.

◆ ConstInputReference

template<class InputType = RealVector>
typedef base_type::ConstInputReference shark::PointSetKernel< InputType >::ConstInputReference

Definition at line 69 of file PointSetKernel.h.

Constructor & Destructor Documentation

◆ PointSetKernel()

Member Function Documentation

◆ createState()

template<class InputType = RealVector>
boost::shared_ptr<State> shark::PointSetKernel< InputType >::createState ( ) const
inlinevirtual

creates the internal state of the kernel

Reimplemented from shark::AbstractKernelFunction< Batch< InputType >::type >.

Definition at line 93 of file PointSetKernel.h.

◆ eval() [1/3]

template<class InputType = RealVector>
double shark::PointSetKernel< InputType >::eval ( ConstInputReference  x1,
ConstInputReference  x2 
) const
inlinevirtual

evaluates \( k(x,y) \)

calculates

\[ \tilde k(x, y) := \frac{k(x, y)}{\sqrt{k(x, x) \cdot k(y, y)}} \]

Reimplemented from shark::AbstractKernelFunction< Batch< InputType >::type >.

Definition at line 102 of file PointSetKernel.h.

◆ eval() [2/3]

template<class InputType = RealVector>
void shark::PointSetKernel< InputType >::eval ( ConstBatchInputReference const &  batchX1,
ConstBatchInputReference const &  batchX2,
RealMatrix &  result,
State state 
) const
inline

◆ eval() [3/3]

template<class InputType = RealVector>
void shark::PointSetKernel< InputType >::eval ( ConstBatchInputReference const &  batchX1,
ConstBatchInputReference const &  batchX2,
RealMatrix &  result 
) const
inline

◆ name()

template<class InputType = RealVector>
std::string shark::PointSetKernel< InputType >::name ( ) const
inlinevirtual

returns the name of the object

Reimplemented from shark::INameable.

Definition at line 77 of file PointSetKernel.h.

References shark::PointSetKernel< InputType >::m_base, and shark::INameable::name().

◆ numberOfParameters()

template<class InputType = RealVector>
std::size_t shark::PointSetKernel< InputType >::numberOfParameters ( ) const
inlinevirtual

◆ parameterVector()

template<class InputType = RealVector>
RealVector shark::PointSetKernel< InputType >::parameterVector ( ) const
inlinevirtual

Return the parameter vector.

Reimplemented from shark::IParameterizable<>.

Definition at line 80 of file PointSetKernel.h.

References shark::PointSetKernel< InputType >::m_base, and shark::IParameterizable< VectorType >::parameterVector().

◆ setParameterVector()

template<class InputType = RealVector>
void shark::PointSetKernel< InputType >::setParameterVector ( RealVector const &  newParameters)
inlinevirtual

Set the parameter vector.

Reimplemented from shark::IParameterizable<>.

Definition at line 84 of file PointSetKernel.h.

References shark::PointSetKernel< InputType >::m_base, and shark::IParameterizable< VectorType >::setParameterVector().

◆ weightedParameterDerivative()

template<class InputType = RealVector>
void shark::PointSetKernel< InputType >::weightedParameterDerivative ( ConstBatchInputReference const &  batchX1,
ConstBatchInputReference const &  batchX2,
RealMatrix const &  coefficients,
State const &  state,
RealVector &  gradient 
) const
inline

Member Data Documentation

◆ m_base


The documentation for this class was generated from the following file: