Use fabs in Huber condition
parent
47d787b478
commit
6cdc1de268
|
@ -696,7 +696,7 @@ Huber::Huber(double k, const ReweightScheme reweight)
|
||||||
}
|
}
|
||||||
|
|
||||||
double Huber::weight(double error) const {
|
double Huber::weight(double error) const {
|
||||||
return (error < k_) ? (1.0) : (k_ / fabs(error));
|
return (fabs(error) > k_) ? k_ / fabs(error) : 1.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Huber::print(const std::string &s="") const {
|
void Huber::print(const std::string &s="") const {
|
||||||
|
|
Loading…
Reference in New Issue