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 TypeMethodDescriptionint
Number of elements in the residualdouble
process
(double[] input) Computes the lost functionvoid
process
(double[] input, double[] output) Computes the gradientvoid
setNumberOfFunctions
(int value) Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ddogleg.optimization.loss.LossFunction
fixate, getNumOfInputsN
Methods 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:
process
in interfaceFunctionNtoS
- Parameters:
input
- Array containing input values- Returns:
- The output.
-
process
public void process(double[] input, double[] output) Computes the gradient- Specified by:
process
in 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:LossFunction
Number of elements in the residual- Specified by:
getNumberOfFunctions
in interfaceLossFunction
- Specified by:
getNumberOfFunctions
in interfaceLossFunctionGradient
-
setNumberOfFunctions
public void setNumberOfFunctions(int value) - Specified by:
setNumberOfFunctions
in interfaceLossFunction
- Specified by:
setNumberOfFunctions
in interfaceLossFunctionGradient
-