shark::MultiTaskKernel< InputTypeT > Class Template Reference

Special kernel function for multi-task and transfer learning. More...

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

+ Inheritance diagram for shark::MultiTaskKernel< InputTypeT >:

Public Types

typedef AbstractKernelFunction< InputTypeT > InputKernelType
 
- Public Types inherited from shark::ProductKernel< MultiTaskSample< InputTypeT > >
typedef AbstractKernelFunction< MultiTaskSample< InputTypeT > > SubKernel
 
typedef base_type::BatchInputType BatchInputType
 
typedef base_type::ConstInputReference ConstInputReference
 
typedef base_type::ConstBatchInputReference ConstBatchInputReference
 
- Public Types inherited from shark::AbstractKernelFunction< MultiTaskSample< InputTypeT > >
enum  Feature
 enumerations of kerneland metric features (flags) More...
 
typedef base_type::InputType InputType
 Input type of the Kernel. More...
 
typedef base_type::BatchInputType BatchInputType
 batch input type of the kernel More...
 
typedef base_type::ConstInputReference ConstInputReference
 Const references to InputType. More...
 
typedef base_type::ConstBatchInputReference ConstBatchInputReference
 Const references to BatchInputType. More...
 
typedef TypedFlags< FeatureFeatures
 This statement declares the member m_features. See Core/Flags.h for details. More...
 
typedef TypedFeatureNotAvailableException< FeatureFeatureNotAvailableException
 
- Public Types inherited from shark::AbstractMetric< MultiTaskSample< InputTypeT > >
typedef MultiTaskSample< InputTypeT > InputType
 Input type of the Kernel. More...
 
typedef Batch< MultiTaskSample< InputTypeT > >::type BatchInputType
 batch input type of the kernel More...
 
typedef ConstProxyReference< InputType const >::type ConstInputReference
 Const references to InputType. More...
 
typedef ConstProxyReference< BatchInputType const >::type ConstBatchInputReference
 Const references to BatchInputType. More...
 
- Public Types inherited from shark::IParameterizable<>
typedef RealVector ParameterVectorType
 

Public Member Functions

 MultiTaskKernel (InputKernelType *inputkernel, DiscreteKernel *taskkernel)
 Constructor. More...
 
std::string name () const
 From INameable: return the class name. More...
 
- Public Member Functions inherited from shark::ProductKernel< MultiTaskSample< InputTypeT > >
 ProductKernel ()
 Default constructor. More...
 
 ProductKernel (SubKernel *k1, SubKernel *k2)
 Constructor for a product of two kernels. More...
 
 ProductKernel (std::vector< SubKernel * > kernels)
 
std::string name () const
 From INameable: return the class name. More...
 
void addKernel (SubKernel *k)
 Add one more kernel to the expansion. 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...
 
double eval (ConstInputReference x1, ConstInputReference x2) const
 evaluates the kernel function More...
 
void eval (ConstBatchInputReference batchX1, ConstBatchInputReference batchX2, RealMatrix &result) const
 Evaluates the subset of the KernelGram matrix which is defined by X1(rows) and X2 (columns). More...
 
void eval (ConstBatchInputReference batchX1, ConstBatchInputReference batchX2, RealMatrix &result, State &state) const
 Evaluates the subset of the KernelGram matrix which is defined by X1(rows) and X2 (columns). More...
 
void read (InArchive &ar)
 From ISerializable. More...
 
void write (OutArchive &ar) const
 From ISerializable. More...
 
- Public Member Functions inherited from shark::AbstractKernelFunction< MultiTaskSample< InputTypeT > >
 AbstractKernelFunction ()
 
const Featuresfeatures () const
 
virtual void updateFeatures ()
 
bool hasFirstParameterDerivative () const
 
bool hasFirstInputDerivative () const
 
bool isNormalized () const
 
bool supportsVariableInputSize () const
 
virtual boost::shared_ptr< StatecreateState () const
 Creates an internal state of the kernel. More...
 
double operator() (ConstInputReference x1, ConstInputReference x2) const
 Convenience operator which evaluates the kernel function. More...
 
RealMatrix operator() (ConstBatchInputReference batchX1, ConstBatchInputReference batchX2) const
 Evaluates the subset of the KernelGram matrix which is defined by X1(rows) and X2 (columns). More...
 
virtual void weightedParameterDerivative (ConstBatchInputReference batchX1, ConstBatchInputReference batchX2, RealMatrix const &coefficients, State const &state, RealVector &gradient) const
 Computes the gradient of the parameters as a weighted sum over the gradient of all elements of the batch. More...
 
virtual void weightedInputDerivative (ConstBatchInputReference batchX1, ConstBatchInputReference batchX2, RealMatrix const &coefficientsX2, State const &state, BatchInputType &gradient) const
 Calculates the derivative of the inputs X1 (only x1!). More...
 
virtual double featureDistanceSqr (ConstInputReference x1, ConstInputReference x2) const
 Computes the squared distance in the kernel induced feature space. More...
 
virtual RealMatrix featureDistanceSqr (ConstBatchInputReference batchX1, ConstBatchInputReference batchX2) const
 Computes the squared distance in the kernel induced feature space. More...
 
- Public Member Functions inherited from shark::AbstractMetric< MultiTaskSample< InputTypeT > >
 AbstractMetric ()
 
virtual ~AbstractMetric ()
 
virtual double featureDistanceSqr (ConstInputReference x1, ConstInputReference x2) const=0
 Computes the squared distance in the kernel induced feature space. More...
 
virtual RealMatrix featureDistanceSqr (ConstBatchInputReference batchX1, ConstBatchInputReference batchX2) const=0
 
double featureDistance (ConstInputReference x1, ConstInputReference x2) const
 Computes the distance in the kernel induced feature space. More...
 
- 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 ()
 

Additional Inherited Members

- Protected Attributes inherited from shark::ProductKernel< MultiTaskSample< InputTypeT > >
std::vector< SubKernel *> m_kernels
 vector of sub-kernels More...
 
std::size_t m_numberOfParameters
 total number of parameters in the product (this is redundant information) More...
 
- Protected Attributes inherited from shark::AbstractKernelFunction< MultiTaskSample< InputTypeT > >
Features m_features
 

Detailed Description

template<class InputTypeT>
class shark::MultiTaskKernel< InputTypeT >

Special kernel function for multi-task and transfer learning.

This class is a convenience wrapper for the product of an input kernel and a kernel on tasks. It also encapsulates the projection from multi-task learning data (see class MultiTaskSample) to inputs and task indices.

Definition at line 297 of file MultiTaskKernel.h.

Member Typedef Documentation

◆ InputKernelType

template<class InputTypeT>
typedef AbstractKernelFunction<InputTypeT> shark::MultiTaskKernel< InputTypeT >::InputKernelType

Definition at line 305 of file MultiTaskKernel.h.

Constructor & Destructor Documentation

◆ MultiTaskKernel()

template<class InputTypeT>
shark::MultiTaskKernel< InputTypeT >::MultiTaskKernel ( InputKernelType inputkernel,
DiscreteKernel taskkernel 
)
inline

Constructor.

Parameters
inputkernelkernel on inputs
taskkernelkernel on task indices

Definition at line 310 of file MultiTaskKernel.h.

Member Function Documentation

◆ name()

template<class InputTypeT>
std::string shark::MultiTaskKernel< InputTypeT >::name ( ) const
inlinevirtual

From INameable: return the class name.

Reimplemented from shark::INameable.

Definition at line 318 of file MultiTaskKernel.h.


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