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

Method filter

dependency/densecrf/src/pairwise.cpp:63–80  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

61 }
62 }
63 void filter( MatrixXf & out, const MatrixXf & in, bool transpose ) const {
64 // Read in the values
65 if( ntype_ == NORMALIZE_SYMMETRIC || (ntype_ == NORMALIZE_BEFORE && !transpose) || (ntype_ == NORMALIZE_AFTER && transpose))
66 out = in*norm_.asDiagonal();
67 else
68 out = in;
69
70 // Filter
71 if( transpose )
72 lattice_.compute( out, out, true );
73 else
74 lattice_.compute( out, out );
75// lattice_.compute( out.data(), out.data(), out.rows() );
76
77 // Normalize again
78 if( ntype_ == NORMALIZE_SYMMETRIC || (ntype_ == NORMALIZE_BEFORE && transpose) || (ntype_ == NORMALIZE_AFTER && !transpose))
79 out = out*norm_.asDiagonal();
80 }
81 // Compute d/df a^T*K*b
82 MatrixXf kernelGradient( const MatrixXf & a, const MatrixXf & b ) const {
83 MatrixXf g = 0*f_;

Callers

nothing calls this directly

Calls 2

asDiagonalMethod · 0.45
computeMethod · 0.45

Tested by

no test coverage detected