Template Class SummedGradientFunction¶
Defined in File functions.h
Inheritance Relationships¶
Derived Type¶
public parpe::SummedGradientFunctionGradientFunctionAdapter< T >
(Template Class SummedGradientFunctionGradientFunctionAdapter)
Class Documentation¶
-
template<typename
T
>
classparpe
::
SummedGradientFunction
¶ The SummedGradientFunction class is an interface for cost functions and gradients that are a sum of functions evaluated on a number of data records. To be used e.g. for mini-batch optimization. Template parameter can be used for data indices or directly for data points.
Subclassed by parpe::SummedGradientFunctionGradientFunctionAdapter< T >
Public Functions
-
virtual FunctionEvaluationStatus
evaluate
(gsl::span<const double> parameters, T dataset, double &fval, gsl::span<double> gradient, Logger *logger, double *cpuTime) const = 0¶ Evaluate on single data point.
- Return
Evaluation status
- Parameters
parameters
: Parameter vector where the function is to be evaluateddataset
: The dataset on which to evaluate the functionfval
: Output argument for f(x)gradient
: Preallocated space for the gradient of size dim(parameters). Or gsl::span<double>() for evaluation without gradient.logger
: Optional Logger instance used for outputcputime
: Optional output argument to reoprt cpuTime consumed by the the function
-
virtual FunctionEvaluationStatus
evaluate
(gsl::span<const double> parameters, std::vector<T> datasets, double &fval, gsl::span<double> gradient, Logger *logger, double *cpuTime) const = 0¶ Evaluate on vector of data points.
- Return
Evaluation status
- Parameters
parameters
: Parameter vector where the function is to be evaluateddatasets
: The datasets on which to evaluate the functionfval
: Output argument for f(x)gradient
: Preallocated space for the gradient of size dim(parameters). Or gsl::span<double>() for evaluation without gradient.logger
: Optional Logger instance used for outputcputime
: Optional output argument to reoprt cpuTime consumed by the the function
-
virtual int
numParameters
() const = 0¶ Get dimension of function parameter vector.
- Return
Number of parameters
-
virtual std::vector<std::string>
getParameterIds
() const = 0¶
-
virtual
~SummedGradientFunction
() = default¶
-
virtual FunctionEvaluationStatus