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 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< Feature > | Features |
| typedef TypedFeatureNotAvailableException< Feature > | FeatureNotAvailableException |
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 Features & | features () const |
| virtual void | updateFeatures () |
| bool | hasFirstParameterDerivative () const |
| Returns true when the first parameter derivative is implemented. More... | |
| bool | hasSecondParameterDerivative () const |
| Returns true when the second parameter derivative is implemented. More... | |
| bool | hasFirstInputDerivative () const |
| Returns true when the first input derivative is implemented. More... | |
| bool | hasSecondInputDerivative () const |
| Returns true when the second parameter derivative is implemented. More... | |
| bool | isSequential () const |
| virtual boost::shared_ptr< State > | createState () 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< OutputType > | operator() (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 &coefficients, State const &state, RealVector &derivative) const |
| calculates the weighted sum of derivatives w.r.t the parameters. More... | |
| virtual void | weightedParameterDerivative (BatchInputType const &pattern, BatchOutputType const &coefficients, Batch< RealMatrix >::type const &errorHessian, State const &state, RealVector &derivative, RealMatrix &hessian) const |
| calculates the weighted sum of derivatives w.r.t the parameters More... | |
| virtual void | weightedInputDerivative (BatchInputType const &pattern, BatchOutputType const &coefficients, State const &state, BatchInputType &derivative) const |
| calculates the weighted sum of derivatives w.r.t the inputs More... | |
| virtual void | weightedInputDerivative (BatchInputType const &pattern, BatchOutputType const &coefficients, typename Batch< RealMatrix >::type const &errorHessian, State const &state, RealMatrix &derivative, Batch< RealMatrix >::type &hessian) const |
| calculates the weighted sum of derivatives w.r.t the inputs More... | |
| virtual void | weightedDerivatives (BatchInputType const &patterns, BatchOutputType const &coefficients, State const &state, RealVector ¶meterDerivative, BatchInputType &inputDerivative) const |
| calculates weighted input and parameter derivative at the same time More... | |
Public Member Functions inherited from shark::IParameterizable | |
| 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 | |
| ClusteringType * | mep_clustering |
| Clustering object, see class AbstractClustering. More... | |
Protected Attributes inherited from shark::AbstractModel< InputT, OutputT > | |
| Features | m_features |
Abstract model with associated clustering object.
See HardClusteringModel and SoftClusteringModel for details.
Definition at line 50 of file ClusteringModel.h.
| typedef base_type::BatchInputType shark::ClusteringModel< InputT, OutputT >::BatchInputType |
Definition at line 55 of file ClusteringModel.h.
| typedef base_type::BatchOutputType shark::ClusteringModel< InputT, OutputT >::BatchOutputType |
Definition at line 56 of file ClusteringModel.h.
| typedef AbstractClustering<InputT> shark::ClusteringModel< InputT, OutputT >::ClusteringType |
Definition at line 54 of file ClusteringModel.h.
|
inline |
Constructor.
Definition at line 59 of file ClusteringModel.h.
|
inlinevirtual |
Standard interface for evaluating the response of the model to a batch of patterns.
| patterns | the inputs of the model |
| outputs | the predictions or response of the model to every pattern |
| state | intermediate 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().
|
inlinevirtual |
Redirect parameter access to the clustering object.
Reimplemented from shark::IParameterizable.
Definition at line 73 of file ClusteringModel.h.
|
inlinevirtual |
Redirect parameter access to the clustering object.
Reimplemented from shark::IParameterizable.
Definition at line 65 of file ClusteringModel.h.
|
inlinevirtual |
From ISerializable, reads a model from an archive.
Reimplemented from shark::AbstractModel< InputT, OutputT >.
Definition at line 77 of file ClusteringModel.h.
|
inlinevirtual |
Redirect parameter access to the clustering object.
Reimplemented from shark::IParameterizable.
Definition at line 69 of file ClusteringModel.h.
|
inlinevirtual |
From ISerializable, writes a model to an archive.
Reimplemented from shark::AbstractModel< InputT, OutputT >.
Definition at line 81 of file ClusteringModel.h.
|
protected |
Clustering object, see class AbstractClustering.
Definition at line 91 of file ClusteringModel.h.
Referenced by shark::ClusteringModel< InputT, unsigned int >::numberOfParameters(), shark::ClusteringModel< InputT, unsigned int >::parameterVector(), shark::ClusteringModel< InputT, unsigned int >::read(), shark::ClusteringModel< InputT, unsigned int >::setParameterVector(), and shark::ClusteringModel< InputT, unsigned int >::write().