Package de.jungblut.math.minimize
Class NegatedCostFunction
- java.lang.Object
-
- de.jungblut.math.minimize.NegatedCostFunction
-
- All Implemented Interfaces:
CostFunction
public final class NegatedCostFunction extends java.lang.Object implements CostFunction
Negated cost function to implement maximization problems. It simply negates the gradient input and the cost, so this change is transparent to the minimizer that is calling this function.- Author:
- thomas.jungblut
-
-
Constructor Summary
Constructors Constructor Description NegatedCostFunction(CostFunction minableCostFunction)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description CostGradientTupleevaluateCost(de.jungblut.math.DoubleVector input)Evaluation for the cost function to retrieve cost and gradient.
-
-
-
Constructor Detail
-
NegatedCostFunction
public NegatedCostFunction(CostFunction minableCostFunction)
-
-
Method Detail
-
evaluateCost
public CostGradientTuple evaluateCost(de.jungblut.math.DoubleVector input)
Description copied from interface:CostFunctionEvaluation for the cost function to retrieve cost and gradient.- Specified by:
evaluateCostin interfaceCostFunction- Parameters:
input- a given input vector- Returns:
- a tuple consists of J (cost) and a vector X which is the gradient of the input.
-
-