Direct Graphical Models  v.1.7.0
TrainEdgePotts.cpp
1 #include "TrainEdgePotts.h"
2 #include "macroses.h"
3 
4 namespace DirectGraphicalModels
5 {
6  Mat CTrainEdgePotts::calculateEdgePotentials(const Mat &, const Mat &, const vec_float_t &vParams) const
7  {
8  if (vParams.size() == 1) return getDefaultEdgePotentials(vParams[0], m_nStates);
9  else if (vParams.size() == m_nStates) return getDefaultEdgePotentials(vParams);
10  else DGM_ASSERT_MSG(false, "Wrong number of parameters: %zu. It must be either %d or %u", vParams.size(), 1, m_nStates);
11  }
12 }
virtual Mat calculateEdgePotentials(const Mat &featureVector1, const Mat &featureVector2, const vec_float_t &vParams) const
Returns the data-independent edge potentials.
static Mat getDefaultEdgePotentials(float val, byte nStates)
Returns the data-independent edge potentials.
Definition: TrainEdge.h:74
byte m_nStates
The number of states (classes)