Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

more efficient trustregion reduction method for failed GN steps

  • Loading branch information...
commit 9011c64cdffc01cff05a6dabb5123b4de31a63bf 1 parent 695daa3
@dkogan dkogan authored
Showing with 15 additions and 1 deletion.
  1. +15 −1 dogleg.c
View
16 dogleg.c
@@ -537,8 +537,22 @@ static int evaluateStep_adjustTrustRegion(const dogleg_operatingPoint_t* before,
fprintf(stderr, "expected improvement: %.20f, got improvement %.20f. rho = %.20f\n",
expectedImprovement, observedImprovement, rho);
- if(rho < TRUSTREGION_DECREASE_THRESHOLD)
+
+ // adjust the trust region
+ if( rho < TRUSTREGION_DECREASE_THRESHOLD )
+ {
+ if( DOGLEG_DEBUG )
+ fprintf(stderr, "rho too small. decreasing trust region\n");
+
+ // Our model doesn't fit well. We should reduce the trust region size. If
+ // the trust region size was affecting the attempted step, do this by a
+ // constant factor. Otherwise, drop the trustregion to attempted step size
+ // first
+ if( !before->didStepToEdgeOfTrustRegion )
+ *trustregion = sqrt(before->updateGN_lensq);
+
*trustregion *= TRUSTREGION_DECREASE_FACTOR;
+ }
else if (rho > TRUSTREGION_INCREASE_THRESHOLD && before->didStepToEdgeOfTrustRegion)
{
if( DOGLEG_DEBUG )
Please sign in to comment.
Something went wrong with that request. Please try again.