shark::NormalizeKernelUnitVariance< InputType > Class Template Reference

Determine the scaling factor of a ScaledKernel so that it has unit variance in feature space one on a given dataset. More...

#include <shark/Algorithms/Trainers/NormalizeKernelUnitVariance.h>

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

Public Member Functions

 NormalizeKernelUnitVariance ()
 
std::string name () const
 From INameable: return the class name. More...
 
double trace () const
 
double mean () const
 
void train (ScaledKernel< InputType > &kernel, UnlabeledData< InputType > const &input)
 
- Public Member Functions inherited from shark::AbstractUnsupervisedTrainer< ScaledKernel< InputType > >
virtual void train (ModelType &model, const UnlabeledData< InputType > &inputset)=0
 Core of the Trainer interface. More...
 
- Public Member Functions inherited from shark::INameable
virtual ~INameable ()
 
- Public Member Functions inherited from shark::ISerializable
virtual ~ISerializable ()
 Virtual d'tor. More...
 
virtual void read (InArchive &archive)
 Read the component from the supplied archive. More...
 
virtual void write (OutArchive &archive) const
 Write the component to the supplied archive. 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

double m_mean
 
double m_matrixTrace
 

Additional Inherited Members

- Public Types inherited from shark::AbstractUnsupervisedTrainer< ScaledKernel< InputType > >
typedef ScaledKernel< InputTypeModelType
 
typedef ScaledKernel< InputType > ::InputType InputType
 

Detailed Description

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

Determine the scaling factor of a ScaledKernel so that it has unit variance in feature space one on a given dataset.

For example in the multiple kernel learning setting, it can be important that the sub-kernels are normalized to unit variance in feature space. This class computes both the trace and the mean of a kernel matrix, and uses both to employ the "Multiplicative Kernel Scaling" laid out in "Kloft, Brefeld, Sonnenburg, Zien: l_p-Norm Multiple Kernel Learning. JMLR 12, 2011.". Given a ScaledKernel, which itself holds an arbitrary underlying kernel k, we compute

\[ \frac{1}{N}\sum_{i=1}^N k(x_i,x_i) - \frac{1}{N^2} \sum_{i,j=1}^N k(x_i,x_j) \]

Definition at line 61 of file NormalizeKernelUnitVariance.h.

Constructor & Destructor Documentation

◆ NormalizeKernelUnitVariance()

template<class InputType = RealVector>
shark::NormalizeKernelUnitVariance< InputType >::NormalizeKernelUnitVariance ( )
inline

Definition at line 65 of file NormalizeKernelUnitVariance.h.

Member Function Documentation

◆ mean()

template<class InputType = RealVector>
double shark::NormalizeKernelUnitVariance< InputType >::mean ( ) const
inline

◆ name()

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

From INameable: return the class name.

Reimplemented from shark::INameable.

Definition at line 69 of file NormalizeKernelUnitVariance.h.

◆ trace()

template<class InputType = RealVector>
double shark::NormalizeKernelUnitVariance< InputType >::trace ( ) const
inline

◆ train()

Member Data Documentation

◆ m_matrixTrace

template<class InputType = RealVector>
double shark::NormalizeKernelUnitVariance< InputType >::m_matrixTrace
protected

◆ m_mean


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