@ Override protected boolean computeStep ( ) { // If first iteration and automatic if ( regionRadius == - 1 ) { // user has selected unconstrained method for initial step size parameterUpdate . computeUpdate ( p , Double . MAX_VALUE ) ; regionRadius = parameterUpdate . getStepLength ( ) ; if ( regionRadius == Double . MAX_VALUE || UtilEjml . isUncountable ( regionRadius ) ) { if ( verbose != null ) verbose . println ( "unconstrained initialization failed. Using Cauchy initialization instead." ) ; regionRadius = - 2 ; } else { if ( verbose != null ) verbose . println ( "unconstrained initialization radius=" + regionRadius ) ; } } if ( regionRadius == - 2 ) { // User has selected Cauchy method for initial step size regionRadius = solveCauchyStepLength ( ) * 10 ; parameterUpdate . computeUpdate ( p , regionRadius ) ; if ( verbose != null ) verbose . println ( "cauchy initialization radius=" + regionRadius ) ; } else { parameterUpdate . computeUpdate ( p , regionRadius ) ; } if ( config . hessianScaling ) undoHessianScalingOnParameters ( p ) ; CommonOps_DDRM . add ( x , p , x_next ) ; double fx_candidate = cost ( x_next ) ; if ( UtilEjml . isUncountable ( fx_candidate ) ) { throw new OptimizationException ( "Uncountable candidate cost. " + fx_candidate ) ; } // this notes that the cost was computed at x_next for the Hessian calculation. // This is a relic from a variant on this implementation where another candidate might be considered. I'm // leaving this code where since it might be useful in the future and doesn't add much complexity sameStateAsCost = true ; // NOTE: step length was computed using the weighted/scaled version of 'p', which is correct return considerCandidate ( fx_candidate , fx , parameterUpdate . getPredictedReduction ( ) , parameterUpdate . getStepLength ( ) ) ; }
Changes the trust region s size and attempts to do a step again