Direct Graphical Models  v.1.7.0
TrainEdgePotts.h
1 // Potts training model for pairwise potentials
2 // Written by Sergey G. Kosov in 2015 for Project X
3 #pragma once
4 
5 #include "TrainEdge.h"
6 
7 namespace DirectGraphicalModels
8 {
9  // ============================= Potts Train Class =============================
19  class CTrainEdgePotts : public CTrainEdge
20  {
21  public:
27  DllExport CTrainEdgePotts(byte nStates, word nFeatures) : CBaseRandomModel(nStates), CTrainEdge(nStates, nFeatures) {}
28  DllExport virtual ~CTrainEdgePotts(void) {}
29 
30  DllExport virtual void reset(void) {}
31 
32  DllExport virtual void addFeatureVecs(const Mat &featureVector1, byte gt1, const Mat &featureVector2, byte gt2) {}
33 
34 
35  protected:
36  DllExport virtual void saveFile(FILE *pFile) const {}
37  DllExport virtual void loadFile(FILE *pFile) {}
51  DllExport virtual Mat calculateEdgePotentials(const Mat &featureVector1, const Mat &featureVector2, const vec_float_t &vParams) const;
52  };
53 }
CTrainEdgePotts(byte nStates, word nFeatures)
Constructor.
virtual void addFeatureVecs(const Mat &featureVector1, byte gt1, const Mat &featureVector2, byte gt2)
Adds a pair of feature vectors.
virtual void reset(void)
Resets class variables.
Base abstract class for edge potentials training.
Definition: TrainEdge.h:24
Base abstract class for random model training.
Potts edge training class.
virtual void saveFile(FILE *pFile) const
Saves the random model into the file.
virtual void loadFile(FILE *pFile)
Loads the random model from the file.
virtual Mat calculateEdgePotentials(const Mat &featureVector1, const Mat &featureVector2, const vec_float_t &vParams) const
Returns the data-independent edge potentials.