Package org.ddogleg.optimization.loss
Class LossWeighted
java.lang.Object
org.ddogleg.optimization.loss.LossWeighted
- All Implemented Interfaces:
FunctionNtoN,FunctionNtoS,LossFunction,LossFunctionGradient
- Direct Known Subclasses:
LossIRLS
A weighted least squares cost function. Weights are fixed and never updated.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintNumber of elements in the residualdoubleprocess(double[] input) Computes the lost functionvoidprocess(double[] input, double[] output) Computes the gradientvoidsetNumberOfFunctions(int value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.ddogleg.optimization.loss.LossFunction
fixate, getNumOfInputsNMethods inherited from interface org.ddogleg.optimization.loss.LossFunctionGradient
getN
-
Field Details
-
weights
protected double[] weightsWeight assigned to each function
-
-
Constructor Details
-
LossWeighted
public LossWeighted()
-
-
Method Details
-
process
public double process(double[] input) Computes the lost function- Specified by:
processin interfaceFunctionNtoS- Parameters:
input- Array containing input values- Returns:
- The output.
-
process
public void process(double[] input, double[] output) Computes the gradient- Specified by:
processin interfaceFunctionNtoN- Parameters:
input- Array with the inputs of length N. Not modified.output- Array for storing the output of length N. Modified.
-
getNumberOfFunctions
public int getNumberOfFunctions()Description copied from interface:LossFunctionNumber of elements in the residual- Specified by:
getNumberOfFunctionsin interfaceLossFunction- Specified by:
getNumberOfFunctionsin interfaceLossFunctionGradient
-
setNumberOfFunctions
public void setNumberOfFunctions(int value) - Specified by:
setNumberOfFunctionsin interfaceLossFunction- Specified by:
setNumberOfFunctionsin interfaceLossFunctionGradient
-