do not cross upper bound for lambda

release/4.3a0
Luca 2014-02-16 16:33:43 -05:00
parent a1ff716daf
commit 4aec076568
1 changed files with 5 additions and 3 deletions

View File

@ -184,10 +184,12 @@ void LevenbergMarquardtOptimizer::iterate() {
if (error < state_.error) {
state_.values.swap(newValues);
state_.error = error;
if(modelFidelity > params_.minModelFidelity)
if(modelFidelity > params_.minModelFidelity){
decreaseLambda(modelFidelity);
else
increaseLambda(modelFidelity);
}else{
if(state_.lambda < params_.lambdaUpperBound)
increaseLambda(modelFidelity);
}
break;
} else {
// Either we're not cautious, or the same lambda was worse than the current error.