43 DllExport
static std::shared_ptr<CTrainEdge>
create(byte edgeRandomModel, byte nStates, word nFeatures);
53 DllExport
virtual void addFeatureVecs(
const Mat &featureVector1, byte gt1,
const Mat &featureVector2, byte gt2) = 0;
54 DllExport
virtual void train(
bool doClean =
false) {}
65 DllExport Mat
getEdgePotentials(
const Mat &featureVector1,
const Mat &featureVector2,
const vec_float_t &vParams,
float weight = 1.0f)
const;
97 DllExport
virtual Mat
calculateEdgePotentials(
const Mat &featureVector1,
const Mat &featureVector2,
const vec_float_t &vParams)
const = 0;
Mat getEdgePotentials(const Mat &featureVector1, const Mat &featureVector2, const vec_float_t &vParams, float weight=1.0f) const
Returns the edge potential, based on the feature vectors.
CTrainEdge(byte nStates, word nFeatures)
Constructor.
virtual Mat calculateEdgePotentials(const Mat &featureVector1, const Mat &featureVector2, const vec_float_t &vParams) const =0
Calculates the edge potential, based on the feature vectors.
Contrast-Sensitive Potts Model.
virtual ~CTrainEdge(void)=default
static std::shared_ptr< CTrainEdge > create(byte edgeRandomModel, byte nStates, word nFeatures)
Factory method returning edge trainer object.
Base abstract class for edge potentials training.
Base abstract class for random model training.
virtual void train(bool doClean=false)
Random model training.
EdgeRandomModel
Types of the edge potential finction.
Contrast-Sensitive Potts Model with Prior.
virtual void addFeatureVecs(const Mat &featureVector1, byte gt1, const Mat &featureVector2, byte gt2)=0
Adds a pair of feature vectors.
static Mat getDefaultEdgePotentials(float val, byte nStates)
Returns the data-independent edge potentials.
Interface class for random model training.