Package net.sf.tweety.math.opt.solver
Class HessianGradientDescent
- java.lang.Object
-
- net.sf.tweety.math.opt.Solver
-
- net.sf.tweety.math.opt.solver.HessianGradientDescent
-
public class HessianGradientDescent extends Solver
This class implements a gradient descent involving Hessian correction for solving unconstrained optimization problems.- Author:
- Matthias Thimm
-
-
Field Summary
Fields Modifier and Type Field Description private org.slf4j.Logger
log
Logger.private static double
PRECISION
private java.util.Map<Variable,Term>
startingPoint
The starting point for the solver.
-
Constructor Summary
Constructors Constructor Description HessianGradientDescent(java.util.Map<Variable,Term> startingPoint)
-
Method Summary
Modifier and Type Method Description private double[]
bestGuess(double[] currentGuess, double[] dir, java.util.List<Term> gradient, java.util.List<Variable> variables)
Find the best guess.private double[]
getDirection(double[][] approxHessian, double[] evaluatedGradient)
Find the best direction.static boolean
isInstalled()
java.util.Map<Variable,Term>
solve(ConstraintSatisfactionProblem problem)
Computes a solution to the given constraint satisfaction or optimization problem, i.e.-
Methods inherited from class net.sf.tweety.math.opt.Solver
getDefaultGeneralSolver, getDefaultIntegerLinearSolver, getDefaultLinearSolver, hasDefaultGeneralSolver, hasDefaultIntegerLinearSolver, hasDefaultLinearSolver, setDefaultGeneralSolver, setDefaultIntegerLinearSolver, setDefaultLinearSolver
-
-
-
-
Field Detail
-
log
private org.slf4j.Logger log
Logger.
-
PRECISION
private static final double PRECISION
- See Also:
- Constant Field Values
-
-
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 classSolver
- 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 guessdir
- the directiongradient
- the gradientvariables
- the variables.- Returns:
- the best guess
-
getDirection
private double[] getDirection(double[][] approxHessian, double[] evaluatedGradient)
Find the best direction.- Parameters:
approxHessian
- the approximated HessianevaluatedGradient
- the evaluated gradient- Returns:
- the direction
-
isInstalled
public static boolean isInstalled() throws java.lang.UnsupportedOperationException
- Throws:
java.lang.UnsupportedOperationException
-
-