/** * Computes all the derived data structures and attempts to update the parameters * @return true if it has converged. */ @Override protected boolean updateDerivates() { functionGradientHessian(x,sameStateAsCost,gradient,hessian); if( config.hessianScaling ) { computeHessianScaling(); applyHessianScaling(); } // Convergence should be tested on scaled variables to remove their arbitrary natural scale // from influencing convergence if( checkConvergenceGTest(gradient)) { if( verbose != null ) { verbose.println("Converged g-test"); } return true; } gradientNorm = NormOps_DDRM.normF(gradient); if(UtilEjml.isUncountable(gradientNorm)) throw new OptimizationException("Uncountable. gradientNorm="+gradientNorm); parameterUpdate.initializeUpdate(); return false; }
/** * Computes all the derived data structures and attempts to update the parameters * @return true if it has converged. */ @Override protected boolean updateDerivates() { functionGradientHessian(x,sameStateAsCost,gradient,hessian); if( config.hessianScaling ) { computeHessianScaling(); applyHessianScaling(); } // Convergence should be tested on scaled variables to remove their arbitrary natural scale // from influencing convergence if( checkConvergenceGTest(gradient)) { if( verbose != null ) { verbose.println("Converged g-test"); } return true; } gradientNorm = NormOps_DDRM.normF(gradient); if(UtilEjml.isUncountable(gradientNorm)) throw new OptimizationException("Uncountable. gradientNorm="+gradientNorm); parameterUpdate.initializeUpdate(); return false; }