Closed moshanATucsd closed 3 years ago
Nice catch! I did make a poop here :smile:
Something more to double check before fixing this:
The Huber norm is e'=2de - d^2 for large e (e is the error, d is the epsilon in Huber norm). It's a bit different from wikipedia since we don't have 1/2 for the errors. Since d^2 does not involve the variables, the Huber norm here can be safely treated as e'=2de.
Because the code here (how we use the weight and error later): https://github.com/KumarRobotics/msckf_vio/blob/0fc32805fc7b1edb0b7db24dcd594b3464c8e2d9/include/msckf_vio/feature.hpp#L373-L375
the weight should be set as w=sqrt(2de)/e = sqrt(2d/e). What do you think?
Hi, thanks for the reply! I think you are right. I just found the Huber norm from dso
float hw = fabsf(residual) < setting_huberTH ? 1 : setting_huberTH / fabsf(residual);
energyLeft += w*w*hw *residual*residual*(2-hw);
{
if(hw < 1) hw = sqrtf(hw);
looks the same as what you said
Do we need 2.0 in line? My derivation agrees with the suggestion of @moshanATucsd on Jul 24. Please also refer to the ceres solver for computing the Huber loss first order derivative which is used to rescale the residuals and Jacobians.
Hi @JzHuai0108, I think I agree with you, even if we do not have 1/2 for the errors, we still don't need the 2, eg refer to eq. 50 in paper. What do you think? @ke-sun
Hi, for Huber robust cost in void Feature::jacobian, I am wondering how to get the following
shouldn't this be
reference TABLE 2 in An Evaluation of Robust Cost Functions for RGB Direct Mapping