Class HessianGradientDescent


  • public class HessianGradientDescent
    extends Solver
    This class implements a gradient descent involving Hessian correction for solving unconstrained optimization problems.
    Author:
    Matthias Thimm
    • Field Detail

      • log

        private org.slf4j.Logger log
        Logger.
      • startingPoint

        private java.util.Map<Variable,​Term> startingPoint
        The starting point for the solver.
    • Constructor Detail

      • HessianGradientDescent

        public HessianGradientDescent​(java.util.Map<Variable,​Term> startingPoint)
    • Method Detail

      • solve

        public java.util.Map<Variable,​Term> solve​(ConstraintSatisfactionProblem problem)
                                                 throws GeneralMathException
        Description copied from class: Solver
        Computes a solution to the given constraint satisfaction or optimization problem, i.e. a mapping from variables of the problem to terms.
        Specified by:
        solve in class Solver
        Parameters:
        problem - the actual problem
        Returns:
        a mapping from variables of the problem to terms.
        Throws:
        GeneralMathException - if something went wrong.
      • bestGuess

        private double[] bestGuess​(double[] currentGuess,
                                   double[] dir,
                                   java.util.List<Term> gradient,
                                   java.util.List<Variable> variables)
        Find the best guess.
        Parameters:
        currentGuess - the current guess
        dir - the direction
        gradient - the gradient
        variables - the variables.
        Returns:
        the best guess
      • getDirection

        private double[] getDirection​(double[][] approxHessian,
                                      double[] evaluatedGradient)
        Find the best direction.
        Parameters:
        approxHessian - the approximated Hessian
        evaluatedGradient - the evaluated gradient
        Returns:
        the direction
      • isInstalled

        public static boolean isInstalled()
                                   throws java.lang.UnsupportedOperationException
        Throws:
        java.lang.UnsupportedOperationException