mirror of
https://github.com/ceres-solver/ceres-solver.git
synced 2026-08-29 08:34:37 +08:00
Adaptive numeric differentiation using Ridders' method.
This method numerically computes function derivatives in different scales, extrapolating between intermediate results to conserve function evaluations. Adaptive differentiation is essential to produce accurate results for functions with noisy derivatives. Full changelist: -Created a new type of NumericDiffMethod (RIDDERS). -Implemented EvaluateRiddersJacobianColumn in NumericDiff. -Created unit tests with f(x) = x^2 + [random noise] and f(x) = exp(x). Change-Id: I2d6e924d7ff686650272f29a8c981351e6f72091
This commit is contained in:
@@ -86,7 +86,7 @@ bool IsClose(double x, double y, double relative_precision,
|
||||
class GradientCheckingCostFunction : public CostFunction {
|
||||
public:
|
||||
GradientCheckingCostFunction(const CostFunction* function,
|
||||
double relative_step_size,
|
||||
const NumericDiffOptions& options,
|
||||
double relative_precision,
|
||||
const string& extra_info)
|
||||
: function_(function),
|
||||
@@ -97,7 +97,7 @@ class GradientCheckingCostFunction : public CostFunction {
|
||||
new DynamicNumericDiffCostFunction<CostFunction, CENTRAL>(
|
||||
function,
|
||||
DO_NOT_TAKE_OWNERSHIP,
|
||||
relative_step_size);
|
||||
options);
|
||||
|
||||
const vector<int32>& parameter_block_sizes =
|
||||
function->parameter_block_sizes();
|
||||
@@ -235,8 +235,11 @@ CostFunction *CreateGradientCheckingCostFunction(
|
||||
double relative_step_size,
|
||||
double relative_precision,
|
||||
const string& extra_info) {
|
||||
NumericDiffOptions numeric_diff_options;
|
||||
numeric_diff_options.relative_step_size = relative_step_size;
|
||||
|
||||
return new GradientCheckingCostFunction(cost_function,
|
||||
relative_step_size,
|
||||
numeric_diff_options,
|
||||
relative_precision,
|
||||
extra_info);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user