MCPcopy Create free account
hub / github.com/HiLab-git/SimpleCRF / inference

Method inference

dependency/densecrf/src/densecrf.cpp:115–131  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

113 }
114}
115MatrixXf DenseCRF::inference ( int n_iterations ) const {
116 MatrixXf Q( M_, N_ ), tmp1, unary( M_, N_ ), tmp2;
117 unary.fill(0);
118 if( unary_ )
119 unary = unary_->get();
120 expAndNormalize( Q, -unary );
121
122 for( int it=0; it<n_iterations; it++ ) {
123 tmp1 = -unary;
124 for( unsigned int k=0; k<pairwise_.size(); k++ ) {
125 pairwise_[k]->apply( tmp2, Q );
126 tmp1 -= tmp2;
127 }
128 expAndNormalize( Q, tmp1 );
129 }
130 return Q;
131}
132VectorXs DenseCRF::map ( int n_iterations ) const {
133 // Run inference
134 MatrixXf Q = inference( n_iterations );

Callers 1

dense_crf_wrapperFunction · 0.45

Calls 5

expAndNormalizeFunction · 0.70
fillMethod · 0.45
getMethod · 0.45
sizeMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected