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

Method inference

dependency/densecrf3d/src/densecrf.cpp:210–226  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

208 }
209}
210MatrixXf DenseCRF::inference ( int n_iterations ) const {
211 MatrixXf Q( M_, N_ ), tmp1, unary( M_, N_ ), tmp2;
212 unary.fill(0);
213 if( unary_ )
214 unary = unary_->get();
215 expAndNormalize( Q, -unary );
216
217 for( int it=0; it<n_iterations; it++ ) {
218 tmp1 = -unary;
219 for( unsigned int k=0; k<pairwise_.size(); k++ ) {
220 pairwise_[k]->apply( tmp2, Q );
221 tmp1 -= tmp2;
222 }
223 expAndNormalize( Q, tmp1 );
224 }
225 return Q;
226}
227VectorXs DenseCRF::map ( int n_iterations ) const {
228 // Run inference
229 MatrixXf Q = inference( n_iterations );

Callers 1

mainFunction · 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