Direct Graphical Models  v.1.7.0
DirectGraphicalModels::CTrainTriplet Class Reference

Base abstract class for triplet potential training. More...

#include <TrainTriplet.h>

Inheritance diagram for DirectGraphicalModels::CTrainTriplet:
Collaboration diagram for DirectGraphicalModels::CTrainTriplet:

Public Member Functions

 CTrainTriplet (byte nStates, byte nFeatures)
 
 ~CTrainTriplet (void)
 
void reset (void)
 Resets class variables. More...
 
void train (bool doClean=false)
 Random model training. More...
 
Mat getTripletPotentials (const Mat &featureVector1, const Mat &featureVector2, const Mat &featureVector3) const
 
- Public Member Functions inherited from DirectGraphicalModels::ITrain
 ITrain (byte nStates, word nFeatures)
 Constructor. More...
 
virtual ~ITrain (void)=default
 
word getNumFeatures (void) const
 Returns number of features. More...
 
- Public Member Functions inherited from DirectGraphicalModels::CBaseRandomModel
 CBaseRandomModel (byte nStates)
 Constructor. More...
 
virtual ~CBaseRandomModel (void)
 
virtual void save (const std::string &path, const std::string &name=std::string(), short idx=-1) const
 Saves the training data. More...
 
virtual void load (const std::string &path, const std::string &name=std::string(), short idx=-1)
 Loads the training data. More...
 
byte getNumStates (void) const
 Returns number of states (classes) More...
 

Protected Member Functions

void saveFile (FILE *pFile) const
 
void loadFile (FILE *pFile)
 
void calculateTripletPotentials (const Mat &featureVector1, const Mat &featureVector2, const Mat &featureVector3) const
 
- Protected Member Functions inherited from DirectGraphicalModels::CBaseRandomModel
std::string generateFileName (const std::string &path, const std::string &name, short idx) const
 Generates name of the data file for storing random model parameters. More...
 

Additional Inherited Members

- Protected Attributes inherited from DirectGraphicalModels::CBaseRandomModel
byte m_nStates
 The number of states (classes) More...
 
- Private Member Functions inherited from DirectGraphicalModels::CPriorTriplet
 CPriorTriplet (byte nStates)
 Constructor. More...
 
 ~CPriorTriplet (void)
 
void addTripletGroundTruth (byte gt1, byte gt2, byte gt3)
 Adds the groud-truth value to the co-occurance histogram matrix. More...
 
Mat calculatePrior (void) const
 Calculates the prior probabilies. More...
 
- Private Member Functions inherited from DirectGraphicalModels::CPrior
 CPrior (byte nStates, RandomModelType type)
 Constructor. More...
 
 ~CPrior (void)
 
Mat getPrior (float weight=1.0f) const
 Returns the prior probabilies. More...
 
- Private Member Functions inherited from DirectGraphicalModels::CBaseRandomModel
 CBaseRandomModel (byte nStates)
 Constructor. More...
 
virtual ~CBaseRandomModel (void)
 
virtual void save (const std::string &path, const std::string &name=std::string(), short idx=-1) const
 Saves the training data. More...
 
virtual void load (const std::string &path, const std::string &name=std::string(), short idx=-1)
 Loads the training data. More...
 
byte getNumStates (void) const
 Returns number of states (classes) More...
 
std::string generateFileName (const std::string &path, const std::string &name, short idx) const
 Generates name of the data file for storing random model parameters. More...
 
- Private Attributes inherited from DirectGraphicalModels::CPrior
Mat m_histogramPrior
 The class cooccurance histogram. More...
 
- Private Attributes inherited from DirectGraphicalModels::CBaseRandomModel
byte m_nStates
 The number of states (classes) More...
 

Detailed Description

Base abstract class for triplet potential training.

Author
Sergey G. Kosov, serge.nosp@m.y.ko.nosp@m.sov@p.nosp@m.roje.nosp@m.ct-10.nosp@m..de

Definition at line 16 of file TrainTriplet.h.

Constructor & Destructor Documentation

◆ CTrainTriplet()

DirectGraphicalModels::CTrainTriplet::CTrainTriplet ( byte  nStates,
byte  nFeatures 
)
inline

Definition at line 19 of file TrainTriplet.h.

◆ ~CTrainTriplet()

DirectGraphicalModels::CTrainTriplet::~CTrainTriplet ( void  )
inline

Definition at line 20 of file TrainTriplet.h.

Member Function Documentation

◆ calculateTripletPotentials()

void DirectGraphicalModels::CTrainTriplet::calculateTripletPotentials ( const Mat &  featureVector1,
const Mat &  featureVector2,
const Mat &  featureVector3 
) const
protected

Definition at line 12 of file TrainTriplet.cpp.

Here is the caller graph for this function:

◆ getTripletPotentials()

Mat DirectGraphicalModels::CTrainTriplet::getTripletPotentials ( const Mat &  featureVector1,
const Mat &  featureVector2,
const Mat &  featureVector3 
) const

Definition at line 6 of file TrainTriplet.cpp.

Here is the call graph for this function:

◆ loadFile()

void DirectGraphicalModels::CTrainTriplet::loadFile ( FILE *  pFile)
inlineprotectedvirtual
Todo:
Implement load() function
Warning
This function is not implemented

Implements DirectGraphicalModels::CBaseRandomModel.

Definition at line 41 of file TrainTriplet.h.

◆ reset()

void DirectGraphicalModels::CTrainTriplet::reset ( void  )
inlinevirtual

Resets class variables.

Allows to re-use the class.

Implements DirectGraphicalModels::CBaseRandomModel.

Definition at line 22 of file TrainTriplet.h.

Here is the call graph for this function:

◆ saveFile()

void DirectGraphicalModels::CTrainTriplet::saveFile ( FILE *  pFile) const
inlineprotectedvirtual
Todo:
Implement save() function
Warning
This function is not implemented

Implements DirectGraphicalModels::CBaseRandomModel.

Definition at line 35 of file TrainTriplet.h.

◆ train()

void DirectGraphicalModels::CTrainTriplet::train ( bool  doClean = false)
inlinevirtual

Random model training.

Auxilary function for training - some derived classes may use this function inbetween training and classification phases

Note
This function must be called inbetween the training and classification phases
Parameters
doCleanFlag indicating if the memory, keeping the trining data should be released after training

Implements DirectGraphicalModels::ITrain.

Definition at line 25 of file TrainTriplet.h.


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