INNER CODE UNIT · C++
pg
lucasb-eyer/pydensecrf · pydensecrf/densecrf/src/densecrf.cpp:282
VectorXf pg = pairwise_[k]->kernelGradient( b, Q[it] );
kernel_grad->segment( ik, pg.rows() ) += pg;
ik += pg.rows();
}
// Compute the new b
pairwise_[k]->applyTranspose( tmp2, b );
tmp1 += tmp2;
}
sumAndNormalize( b, tmp1.array()*Q[it].array(), Q[it] );
// Add the gradient
if(unary_grad && unary_)
*unary_grad += unary_->gradient( b );
}
return r;
}
VectorXf DenseCRF::unaryParameters() const {
if( unary_ )