shark::ClusteringModel< InputT, OutputT > Class Template Reference

Abstract model with associated clustering object. More...

#include <shark/Models/Clustering/ClusteringModel.h>

+ Inheritance diagram for shark::ClusteringModel< InputT, OutputT >:

Public Types

typedef AbstractClustering< InputT > ClusteringType
 
typedef base_type::BatchInputType BatchInputType
 
typedef base_type::BatchOutputType BatchOutputType
 
- Public Types inherited from shark::AbstractModel< InputT, OutputT >
enum  Feature
 
typedef InputT InputType
 Defines the input type of the model. More...
 
typedef OutputT OutputType
 Defines the output type of the model. More...
 
typedef AbstractModel< InputT, OutputT, 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

 ClusteringModel (ClusteringType *clustering)
 Constructor. More...
 
RealVector parameterVector () const
 Redirect parameter access to the clustering object. More...
 
void setParameterVector (RealVector const &newParameters)
 Redirect parameter access to the clustering object. More...
 
std::size_t numberOfParameters () const
 Redirect parameter access to the clustering object. More...
 
void read (InArchive &archive)
 From ISerializable, reads a model from an archive. More...
 
void write (OutArchive &archive) const
 From ISerializable, writes a model to an archive. More...
 
void eval (BatchInputType const &patterns, BatchOutputType &outputs, State &state) const
 Standard interface for evaluating the response of the model to a batch of patterns. More...
 
- Public Member Functions inherited from shark::AbstractModel< InputT, OutputT >
 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 Shape inputShape () const=0
 Returns the expected shape of the input. More...
 
virtual Shape outputShape () const=0
 Returns the shape of the output. More...
 
virtual boost::shared_ptr< StatecreateState () const
 Creates an internal state of the model. More...
 
virtual void eval (BatchInputType const &patterns, BatchOutputType &outputs) const
 Standard interface for evaluating the response of the model to a batch of patterns. More...
 
virtual void eval (InputType const &pattern, OutputType &output) const
 Standard interface for evaluating the response of the model to a single pattern. 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 ()
 
virtual std::string name () const
 returns the name of the object More...
 
- 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

ClusteringTypemep_clustering
 Clustering object, see class AbstractClustering. More...
 
- Protected Attributes inherited from shark::AbstractModel< InputT, OutputT >
Features m_features
 

Detailed Description

template<class InputT, class OutputT>
class shark::ClusteringModel< InputT, OutputT >

Abstract model with associated clustering object.

See HardClusteringModel and SoftClusteringModel for details.

Definition at line 50 of file ClusteringModel.h.

Member Typedef Documentation

◆ BatchInputType

template<class InputT, class OutputT>
typedef base_type::BatchInputType shark::ClusteringModel< InputT, OutputT >::BatchInputType

Definition at line 55 of file ClusteringModel.h.

◆ BatchOutputType

template<class InputT, class OutputT>
typedef base_type::BatchOutputType shark::ClusteringModel< InputT, OutputT >::BatchOutputType

Definition at line 56 of file ClusteringModel.h.

◆ ClusteringType

template<class InputT, class OutputT>
typedef AbstractClustering<InputT> shark::ClusteringModel< InputT, OutputT >::ClusteringType

Definition at line 54 of file ClusteringModel.h.

Constructor & Destructor Documentation

◆ ClusteringModel()

template<class InputT, class OutputT>
shark::ClusteringModel< InputT, OutputT >::ClusteringModel ( ClusteringType clustering)
inline

Constructor.

Definition at line 59 of file ClusteringModel.h.

Member Function Documentation

◆ eval()

template<class InputT, class OutputT>
void shark::ClusteringModel< InputT, OutputT >::eval ( BatchInputType const &  patterns,
BatchOutputType outputs,
State state 
) const
inlinevirtual

Standard interface for evaluating the response of the model to a batch of patterns.

Parameters
patternsthe inputs of the model
outputsthe predictions or response of the model to every pattern
stateintermediate results stored by eval which can be reused for derivative computation.

Implements shark::AbstractModel< InputT, OutputT >.

Definition at line 85 of file ClusteringModel.h.

Referenced by shark::ClusteringModel< InputT, unsigned int >::eval().

◆ numberOfParameters()

template<class InputT, class OutputT>
std::size_t shark::ClusteringModel< InputT, OutputT >::numberOfParameters ( ) const
inlinevirtual

Redirect parameter access to the clustering object.

Reimplemented from shark::IParameterizable< RealVector >.

Definition at line 73 of file ClusteringModel.h.

◆ parameterVector()

template<class InputT, class OutputT>
RealVector shark::ClusteringModel< InputT, OutputT >::parameterVector ( ) const
inlinevirtual

Redirect parameter access to the clustering object.

Reimplemented from shark::IParameterizable< RealVector >.

Definition at line 65 of file ClusteringModel.h.

◆ read()

template<class InputT, class OutputT>
void shark::ClusteringModel< InputT, OutputT >::read ( InArchive archive)
inlinevirtual

From ISerializable, reads a model from an archive.

Reimplemented from shark::AbstractModel< InputT, OutputT >.

Definition at line 77 of file ClusteringModel.h.

◆ setParameterVector()

template<class InputT, class OutputT>
void shark::ClusteringModel< InputT, OutputT >::setParameterVector ( RealVector const &  newParameters)
inlinevirtual

Redirect parameter access to the clustering object.

Reimplemented from shark::IParameterizable< RealVector >.

Definition at line 69 of file ClusteringModel.h.

◆ write()

template<class InputT, class OutputT>
void shark::ClusteringModel< InputT, OutputT >::write ( OutArchive archive) const
inlinevirtual

From ISerializable, writes a model to an archive.

Reimplemented from shark::AbstractModel< InputT, OutputT >.

Definition at line 81 of file ClusteringModel.h.

Member Data Documentation

◆ mep_clustering


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