shark::KernelClassifier< InputType > Struct Template Reference

Linear classifier in a kernel feature space. More...

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

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

Public Types

typedef AbstractKernelFunction< InputTypeKernelType
 
typedef KernelExpansion< InputTypeKernelExpansionType
 
- Public Types inherited from shark::Classifier< KernelExpansion< InputType > >
typedef KernelExpansion< InputType > ::InputType InputType
 
typedef unsigned int OutputType
 
typedef Batch< InputType >::type BatchInputType
 
typedef Batch< unsigned int >::type BatchOutputType
 
- Public Types inherited from shark::AbstractModel< KernelExpansion< InputType > ::InputType, unsigned int >
enum  Feature
 
typedef KernelExpansion< InputType > ::InputType InputType
 Defines the input type of the model. More...
 
typedef unsigned int OutputType
 Defines the output type of the model. More...
 
typedef AbstractModel< KernelExpansion< InputType > ::InputType, unsigned int, RealVector > ModelBaseType
 Defines the BaseType used by the model (this type). Useful for creating derived models. More...
 
typedef Batch< InputType >::type BatchInputType
 defines the batch type of the input type. More...
 
typedef Batch< OutputType >::type BatchOutputType
 defines the batch type of the output type More...
 
typedef TypedFlags< FeatureFeatures
 
typedef TypedFeatureNotAvailableException< FeatureFeatureNotAvailableException
 
- Public Types inherited from shark::IParameterizable< RealVector >
typedef RealVector ParameterVectorType
 

Public Member Functions

 KernelClassifier ()
 
 KernelClassifier (KernelType *kernel)
 
 KernelClassifier (KernelExpansionType const &decisionFunction)
 
std::string name () const
 returns the name of the object More...
 
- Public Member Functions inherited from shark::Classifier< KernelExpansion< InputType > >
 Classifier ()
 
 Classifier (KernelExpansion< InputType > const &decisionFunction)
 
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...
 
Shape inputShape () const
 Returns the expected shape of the input. More...
 
Shape outputShape () const
 Returns the shape of the output. More...
 
RealVector const & bias () const
 
RealVector & bias ()
 
KernelExpansion< InputType > const & decisionFunction () const
 Return the decision function. More...
 
KernelExpansion< InputType > & decisionFunction ()
 Return the decision function. More...
 
void eval (BatchInputType const &input, BatchOutputType &output) const
 
void eval (BatchInputType const &input, BatchOutputType &output, State &state) const
 
void eval (InputType const &pattern, OutputType &output) const
 Standard interface for evaluating the response of the model to a single pattern. More...
 
void read (InArchive &archive)
 From ISerializable. More...
 
void write (OutArchive &archive) const
 From ISerializable. More...
 
- Public Member Functions inherited from shark::AbstractModel< KernelExpansion< InputType > ::InputType, unsigned int >
 AbstractModel ()
 
virtual ~AbstractModel ()
 
const Featuresfeatures () const
 
virtual void updateFeatures ()
 
bool hasFirstParameterDerivative () const
 Returns true when the first parameter derivative is implemented. More...
 
bool hasFirstInputDerivative () const
 Returns true when the first input derivative is implemented. More...
 
virtual boost::shared_ptr< StatecreateState () const
 Creates an internal state of the model. More...
 
Data< OutputTypeoperator() (Data< InputType > const &patterns) const
 Model evaluation as an operator for a whole dataset. This is a convenience function. More...
 
OutputType operator() (InputType const &pattern) const
 Model evaluation as an operator for a single pattern. This is a convenience function. More...
 
BatchOutputType operator() (BatchInputType const &patterns) const
 Model evaluation as an operator for a single pattern. This is a convenience function. More...
 
virtual void weightedParameterDerivative (BatchInputType const &pattern, BatchOutputType const &outputs, BatchOutputType const &coefficients, State const &state, RealVector &derivative) const
 calculates the weighted sum of derivatives w.r.t the parameters. More...
 
virtual void weightedInputDerivative (BatchInputType const &pattern, BatchOutputType const &outputs, BatchOutputType const &coefficients, State const &state, BatchInputType &derivative) const
 calculates the weighted sum of derivatives w.r.t the inputs More...
 
virtual void weightedDerivatives (BatchInputType const &patterns, BatchOutputType const &outputs, BatchOutputType const &coefficients, State const &state, RealVector &parameterDerivative, BatchInputType &inputDerivative) const
 calculates weighted input and parameter derivative at the same time More...
 
- Public Member Functions inherited from shark::IParameterizable< RealVector >
virtual ~IParameterizable ()
 
- Public Member Functions inherited from shark::INameable
virtual ~INameable ()
 
- 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::AbstractModel< KernelExpansion< InputType > ::InputType, unsigned int >
Features m_features
 

Detailed Description

template<class InputType>
struct shark::KernelClassifier< InputType >

Linear classifier in a kernel feature space.

This model is a simple wrapper for the KernelExpansion calculating the arg max of the outputs of the model. This is the model used by kernel classifier models like SVMs.

Definition at line 312 of file KernelExpansion.h.

Member Typedef Documentation

◆ KernelExpansionType

Definition at line 314 of file KernelExpansion.h.

◆ KernelType

Definition at line 313 of file KernelExpansion.h.

Constructor & Destructor Documentation

◆ KernelClassifier() [1/3]

template<class InputType>
shark::KernelClassifier< InputType >::KernelClassifier ( )
inline

Definition at line 316 of file KernelExpansion.h.

◆ KernelClassifier() [2/3]

template<class InputType>
shark::KernelClassifier< InputType >::KernelClassifier ( KernelType kernel)
inline

Definition at line 318 of file KernelExpansion.h.

◆ KernelClassifier() [3/3]

template<class InputType>
shark::KernelClassifier< InputType >::KernelClassifier ( KernelExpansionType const &  decisionFunction)
inline

Definition at line 321 of file KernelExpansion.h.

Member Function Documentation

◆ name()

template<class InputType>
std::string shark::KernelClassifier< InputType >::name ( ) const
inlinevirtual

returns the name of the object

Reimplemented from shark::INameable.

Definition at line 325 of file KernelExpansion.h.

Referenced by main().


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