| 295 | expAndNormalize( Q, tmp1 ); |
| 296 | } |
| 297 | VectorXs DenseCRF::currentMap( const MatrixXf & Q ) const{ |
| 298 | VectorXs r(Q.cols()); |
| 299 | // Find the map |
| 300 | for( int i=0; i<N_; i++ ){ |
| 301 | int m; |
| 302 | Q.col(i).maxCoeff( &m ); |
| 303 | r[i] = m; |
| 304 | } |
| 305 | return r; |
| 306 | } |
| 307 | |
| 308 | // Compute the KL-divergence of a set of marginals |
| 309 | double DenseCRF::klDivergence( const MatrixXf & Q ) const { |