Class 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
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      CostGradientTuple evaluateCost​(de.jungblut.math.DoubleVector input)
      Evaluation for the cost function to retrieve cost and gradient.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • NegatedCostFunction

        public NegatedCostFunction​(CostFunction minableCostFunction)
    • Method Detail

      • evaluateCost

        public CostGradientTuple evaluateCost​(de.jungblut.math.DoubleVector input)
        Description copied from interface: CostFunction
        Evaluation for the cost function to retrieve cost and gradient.
        Specified by:
        evaluateCost in interface CostFunction
        Parameters:
        input - a given input vector
        Returns:
        a tuple consists of J (cost) and a vector X which is the gradient of the input.