iRoCS Toolbox  1.1.0
Public Types | Public Member Functions
svt::Model< FV > Class Template Reference

#include <Model.hh>

Collaboration diagram for svt::Model< FV >:

Public Types

typedef FV FV_type
 

Public Member Functions

 Model ()
 
 Model (int nSupportVectors)
 
 Model (const Model< FV > &orig)
 Copy contructor. More...
 
 ~Model ()
 
double * allAlphas ()
 
const double * allAlphas () const
 
FV ** allSupportVectors ()
 
FV *const * allSupportVectors () const
 
double alpha (unsigned int i) const
 
void copySVCoefsToSupportVectors ()
 
void detachFromTrainingDataSet ()
 
void free_memory ()
 
double getTrainingInfoValue (const std::string &key)
 
bool isModelAffectedByLeftOutVectors (const std::vector< char > &leaveOutFlagsByUID) const
 check, if this model is affected by specified left out vectors, which means, that it needs to be retrained, if these vectors are left out from the training data set More...
 
template<typename STDATA >
void loadParameters (STDATA &stData, const std::string &prefix="")
 load the model data from given structured data. More...
 
template<typename STDATA >
void loadParametersWithUIDs (STDATA &stData, const std::vector< FV *> &fvsByUID, const std::string &prefix="")
 (description) More...
 
Modeloperator= (const Model &orig)
 operator= More...
 
void resize (size_t nSupportVectors)
 
double rho () const
 
template<typename STDATA >
void saveParameters (STDATA &stData, const std::string &prefix="") const
 save the model data to given structured data. More...
 
template<typename STDATA >
void saveParametersWithUIDs (STDATA &stData, const std::string &prefix="") const
 save the model data to string-string map. More...
 
template<typename STDATA >
void saveTrainingInfo (STDATA &stData, const std::string &prefix="")
 
void setRho (double rho)
 
void setSupportVector (unsigned int i, FV *fv, double alpha)
 
template<typename T >
void setTrainingInfoValue (const std::string &key, const T &value)
 
size_t size () const
 
const FV * supportVector (unsigned int i) const
 
FV * supportVector (unsigned int i)
 
std::string trainingInfoPlainText ()
 

Detailed Description

template<typename FV>
class svt::Model< FV >

Definition at line 119 of file Model.hh.

Member Typedef Documentation

◆ FV_type

template<typename FV>
typedef FV svt::Model< FV >::FV_type

Definition at line 124 of file Model.hh.

Constructor & Destructor Documentation

◆ Model() [1/3]

template<typename FV>
svt::Model< FV >::Model ( )
inline

Definition at line 126 of file Model.hh.

◆ Model() [2/3]

template<typename FV>
svt::Model< FV >::Model ( int  nSupportVectors)
inline

Definition at line 135 of file Model.hh.

◆ ~Model()

template<typename FV>
svt::Model< FV >::~Model ( )
inline

Definition at line 145 of file Model.hh.

◆ Model() [3/3]

template<typename FV>
svt::Model< FV >::Model ( const Model< FV > &  orig)
inline

Copy contructor.

Parameters
orig

Definition at line 157 of file Model.hh.

Member Function Documentation

◆ operator=()

template<typename FV>
Model& svt::Model< FV >::operator= ( const Model< FV > &  orig)
inline

operator=

Parameters
orig

Definition at line 174 of file Model.hh.

◆ free_memory()

template<typename FV>
void svt::Model< FV >::free_memory ( )

◆ resize()

template<typename FV>
void svt::Model< FV >::resize ( size_t  nSupportVectors)

◆ size()

template<typename FV>
size_t svt::Model< FV >::size ( ) const
inline

Definition at line 197 of file Model.hh.

◆ setRho()

template<typename FV>
void svt::Model< FV >::setRho ( double  rho)
inline

Definition at line 200 of file Model.hh.

◆ rho()

template<typename FV>
double svt::Model< FV >::rho ( ) const
inline

Definition at line 203 of file Model.hh.

Referenced by svt::Model< FV >::setRho().

◆ setSupportVector()

template<typename FV>
void svt::Model< FV >::setSupportVector ( unsigned int  i,
FV *  fv,
double  alpha 
)
inline

Definition at line 206 of file Model.hh.

◆ supportVector() [1/2]

template<typename FV>
const FV* svt::Model< FV >::supportVector ( unsigned int  i) const
inline

Definition at line 213 of file Model.hh.

◆ supportVector() [2/2]

template<typename FV>
FV* svt::Model< FV >::supportVector ( unsigned int  i)
inline

Definition at line 216 of file Model.hh.

◆ alpha()

template<typename FV>
double svt::Model< FV >::alpha ( unsigned int  i) const
inline

Definition at line 219 of file Model.hh.

Referenced by svt::Model< FV >::setSupportVector().

◆ allSupportVectors() [1/2]

template<typename FV>
FV** svt::Model< FV >::allSupportVectors ( )
inline

Definition at line 224 of file Model.hh.

◆ allSupportVectors() [2/2]

template<typename FV>
FV* const* svt::Model< FV >::allSupportVectors ( ) const
inline

Definition at line 227 of file Model.hh.

◆ allAlphas() [1/2]

template<typename FV>
double* svt::Model< FV >::allAlphas ( )
inline

Definition at line 232 of file Model.hh.

◆ allAlphas() [2/2]

template<typename FV>
const double* svt::Model< FV >::allAlphas ( ) const
inline

Definition at line 235 of file Model.hh.

◆ copySVCoefsToSupportVectors()

template<typename FV>
void svt::Model< FV >::copySVCoefsToSupportVectors ( )

◆ detachFromTrainingDataSet()

template<typename FV>
void svt::Model< FV >::detachFromTrainingDataSet ( )
inline

Definition at line 241 of file Model.hh.

◆ setTrainingInfoValue()

template<typename FV>
template<typename T >
void svt::Model< FV >::setTrainingInfoValue ( const std::string &  key,
const T &  value 
)
inline

Definition at line 254 of file Model.hh.

◆ getTrainingInfoValue()

template<typename FV>
double svt::Model< FV >::getTrainingInfoValue ( const std::string &  key)
inline

Definition at line 259 of file Model.hh.

◆ trainingInfoPlainText()

template<typename FV>
std::string svt::Model< FV >::trainingInfoPlainText ( )
inline

Definition at line 264 of file Model.hh.

◆ saveTrainingInfo()

template<typename FV>
template<typename STDATA >
void svt::Model< FV >::saveTrainingInfo ( STDATA &  stData,
const std::string &  prefix = "" 
)
inline

Definition at line 276 of file Model.hh.

◆ saveParameters()

template<typename FV>
template<typename STDATA >
void svt::Model< FV >::saveParameters ( STDATA &  stData,
const std::string &  prefix = "" 
) const

save the model data to given structured data.

The support vectors are stored as full vectors in "SV"

Parameters

Referenced by svt::Model< FV >::saveTrainingInfo().

◆ loadParameters()

template<typename FV>
template<typename STDATA >
void svt::Model< FV >::loadParameters ( STDATA &  stData,
const std::string &  prefix = "" 
)

load the model data from given structured data.

Use this method only if the feature vectors are stored as full vectors with key "SV". If there are only their uniqueID's in thw key "sv_uids", you must use the loadParametersWithUIDs() method instead

Parameters

Referenced by svt::Model< FV >::saveTrainingInfo().

◆ saveParametersWithUIDs()

template<typename FV>
template<typename STDATA >
void svt::Model< FV >::saveParametersWithUIDs ( STDATA &  stData,
const std::string &  prefix = "" 
) const

save the model data to string-string map.

only the uniqueID's of the support vectors are stored in "sv_uids"

Parameters

Referenced by svt::Model< FV >::saveTrainingInfo().

◆ loadParametersWithUIDs()

template<typename FV>
template<typename STDATA >
void svt::Model< FV >::loadParametersWithUIDs ( STDATA &  stData,
const std::vector< FV *> &  fvsByUID,
const std::string &  prefix = "" 
)

(description)

Parameters

Referenced by svt::Model< FV >::saveTrainingInfo().

◆ isModelAffectedByLeftOutVectors()

template<typename FV>
bool svt::Model< FV >::isModelAffectedByLeftOutVectors ( const std::vector< char > &  leaveOutFlagsByUID) const
inline

check, if this model is affected by specified left out vectors, which means, that it needs to be retrained, if these vectors are left out from the training data set

Parameters
leaveOutFlagsByUIDleave out flag for each feature vector, accessed via its uniqueID (1 means leave this vector out from training)
Returns
true or false

Definition at line 374 of file Model.hh.


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