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

Function expAndNormalize

dependency/densecrf/src/densecrf.cpp:98–106  ·  view source on GitHub ↗

////////////////// Inference ///// //////////////////

Source from the content-addressed store, hash-verified

96///// Inference /////
97///////////////////////
98void expAndNormalize ( MatrixXf & out, const MatrixXf & in ) {
99 out.resize( in.rows(), in.cols() );
100 for( int i=0; i<out.cols(); i++ ){
101 VectorXf b = in.col(i);
102 b.array() -= b.maxCoeff();
103 b = b.array().exp();
104 out.col(i) = b / b.array().sum();
105 }
106}
107void sumAndNormalize( MatrixXf & out, const MatrixXf & in, const MatrixXf & Q ) {
108 out.resize( in.rows(), in.cols() );
109 for( int i=0; i<in.cols(); i++ ){

Callers 4

inferenceMethod · 0.70
startInferenceMethod · 0.70
stepInferenceMethod · 0.70
gradientMethod · 0.70

Calls 7

resizeMethod · 0.45
rowsMethod · 0.45
colsMethod · 0.45
colMethod · 0.45
arrayMethod · 0.45
maxCoeffMethod · 0.45
sumMethod · 0.45

Tested by

no test coverage detected