shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType > Class Template Reference

Internal Wrappertype to connect the output of the first model with the input of the second model. More...

#include <shark/Models/ConcatenatedModel.h>

+ Inheritance diagram for shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >:
+ Collaboration diagram for shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >:

Classes

struct  InternalState
 

Public Types

typedef base_type::BatchInputType BatchInputType
 
typedef base_type::BatchOutputType BatchOutputType
 

Public Member Functions

 ConcatenatedModelWrapper (AbstractModel< InputType, IntermediateType > *firstModel, AbstractModel< IntermediateType, OutputType > *secondModel)
 
std::string name () const
 From INameable: return the class name. More...
 
ConcatenatedModelWrapperBase
< InputType, OutputType > * 
clone () const
 
RealVector parameterVector () const
 Return the parameter vector. More...
 
void setParameterVector (RealVector const &newParameters)
 Set the parameter vector. More...
 
boost::shared_ptr< StatecreateState () const
 Creates an internal state of the model. More...
 
std::size_t numberOfParameters () const
 Return the number of parameters. More...
 
void eval (BatchInputType const &patterns, BatchOutputType &outputs) const
 Standard interface for evaluating the response of the model to a batch of patterns. More...
 
void eval (BatchInputType const &patterns, BatchOutputType &outputs, State &state) const
 
void weightedParameterDerivative (BatchInputType const &patterns, BatchOutputType const &coefficients, State const &state, RealVector &gradient) const
 
void weightedInputDerivative (BatchInputType const &patterns, BatchOutputType const &coefficients, State const &state, BatchOutputType &gradient) const
 
virtual void weightedDerivatives (BatchInputType const &patterns, BatchOutputType const &coefficients, State const &state, RealVector &parameterDerivative, BatchInputType &inputDerivative) const
 
void read (InArchive &archive)
 From ISerializable. More...
 
void write (OutArchive &archive) const
 From ISerializable. More...
 

Protected Types

typedef AbstractModel
< InputType, IntermediateType >
::BatchOutputType 
BatchIntermediateType
 

Protected Attributes

AbstractModel< InputType,
IntermediateType > * 
m_firstModel
 
AbstractModel
< IntermediateType, OutputType > * 
m_secondModel
 

Detailed Description

template<class InputType, class IntermediateType, class OutputType>
class shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >

Internal Wrappertype to connect the output of the first model with the input of the second model.

This model is also created when concatenating two models with operator>> (firstModel>>secondModel)

Definition at line 64 of file ConcatenatedModel.h.

Member Typedef Documentation

template<class InputType, class IntermediateType, class OutputType>
typedef base_type::BatchInputType shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::BatchInputType

Definition at line 77 of file ConcatenatedModel.h.

template<class InputType, class IntermediateType, class OutputType>
typedef AbstractModel<InputType,IntermediateType>::BatchOutputType shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::BatchIntermediateType
protected

Definition at line 66 of file ConcatenatedModel.h.

template<class InputType, class IntermediateType, class OutputType>
typedef base_type::BatchOutputType shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::BatchOutputType

Definition at line 79 of file ConcatenatedModel.h.

Constructor & Destructor Documentation

Member Function Documentation

template<class InputType, class IntermediateType, class OutputType>
ConcatenatedModelWrapperBase<InputType, OutputType>* shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::clone ( ) const
inlinevirtual
template<class InputType, class IntermediateType, class OutputType>
boost::shared_ptr<State> shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::createState ( ) const
inlinevirtual
template<class InputType, class IntermediateType, class OutputType>
void shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::eval ( BatchInputType const &  patterns,
BatchOutputType outputs 
) 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

Reimplemented from shark::AbstractModel< InputType, OutputType >.

Definition at line 140 of file ConcatenatedModel.h.

References shark::AbstractModel< InputTypeT, OutputTypeT >::eval(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::m_firstModel, and shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::m_secondModel.

template<class InputType, class IntermediateType, class OutputType>
void shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::setParameterVector ( RealVector const &  newParameters)
inlinevirtual
template<class InputType, class IntermediateType, class OutputType>
virtual void shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::weightedDerivatives ( BatchInputType const &  patterns,
BatchOutputType const &  coefficients,
State const &  state,
RealVector &  parameterDerivative,
BatchInputType inputDerivative 
) const
inlinevirtual

Member Data Documentation

template<class InputType, class IntermediateType, class OutputType>
AbstractModel<InputType,IntermediateType>* shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::m_firstModel
protected

Definition at line 67 of file ConcatenatedModel.h.

Referenced by shark::detail::ConcatenatedModelList< InputType, IntermediateType, OutputType >::clone(), shark::detail::ConcatenatedModelList< InputType, IntermediateType, OutputType >::ConcatenatedModelList(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::createState(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::eval(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::name(), shark::detail::ConcatenatedModelList< InputType, IntermediateType, OutputType >::name(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::numberOfParameters(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::parameterVector(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::read(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::setParameterVector(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::weightedDerivatives(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::weightedInputDerivative(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::weightedParameterDerivative(), shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::write(), and shark::detail::ConcatenatedModelList< InputType, IntermediateType, OutputType >::~ConcatenatedModelList().

template<class InputType, class IntermediateType, class OutputType>
AbstractModel<IntermediateType,OutputType>* shark::detail::ConcatenatedModelWrapper< InputType, IntermediateType, OutputType >::m_secondModel
protected

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