Ceres Solver 中文文档
  • 😜Ceres Solver 中文文档
  • Why Ceres ?
  • Installation
  • Tutorial
    • Non-linear Least Squares
      • Introduction
      • Hello World
      • Derivatives
        • Numeric Derivatives
        • Analytic Derivatives
        • More About Derivatives
      • Powell’s Function
      • Curve Fitting
      • Robust Curve Fitting
      • Bundle Adjustment
      • Other Examples
    • General Unconstrained Minimization
      • General Unconstrained Minimization
  • On Derivatives
    • Spivak Notation
    • Analytic Derivatives
    • Numeric Derivatives
    • Automatic Derivatives
    • Interfacing with Automatic Differentiation
    • Using Inverse & Implicit Function Theorems
  • Modeling Non-linear Least Squares
    • Introduction
    • Main Class Interface
      • CostFunction
      • SizeCostFunction
      • AutoDiffCostFunction
      • DynamicAutoDiffCostFunction
      • NumericDiffCostFunction
      • DynamicNumericDifferCostFunction
      • CostFunctionToFunctor
      • DynamicCostFunctionToFunctor
      • ConditionedCostFunction
      • GradientChecker
      • NormalPrior
      • LossFunction
      • Manifold
      • AutoDIffManifold
      • Problem
      • EvaluatationCallback
      • Rotation
      • Cubic Interpolation
        • CubicInterpolator
        • BiCubicInterpolator
  • Solveing Non-linear Least Squares
    • Introduction
    • Trust Region Methodd
    • Line Search Methods
    • Linear Solvers
    • Mixed Precision Solves
    • Preconditioners
    • Ordering
    • Main Class Interfaces
      • Solver::Options
      • ParameterBlockOrdering
      • IterationSummary
      • IterationCallback
      • CRSMatrix
      • Solver::Summary
  • Covariance Estimation
    • Introduction
    • Gauge Invariance
    • Covariance
    • Rank of the Jacobian
      • Options
      • Covariance
      • GetCovarianceBlock
      • GetCovarianceBlockInTangentSpace
    • Example Usage
Powered by GitBook
On this page
  1. Modeling Non-linear Least Squares

Introduction

PreviousUsing Inverse & Implicit Function TheoremsNextMain Class Interface

Last updated 1 year ago

Ceres 求解器由两个不同的部分组成。一个是问题构建接口,它提供了一套丰富的工具来逐项构建优化问题;另一个是求解接口,它控制着优化算法的具体参数。本章主要介绍使用 Ceres 对优化问题进行建模的任务。 讨论了使用 Ceres 解决优化问题的各种方法,也就是下一章讨论求解。

Ceres 可以鲁棒的解决以下形式的带有边界约束的非线性最小二乘问题

min⁡x12∑iτi(∥fi(xi1,...,xik)∥2)s.t.  lj≤xj≤μj\min_{\mathbf{x}}\frac{1}{2}\sum_{i}^{}\tau _{i}\left ( \parallel f_i\left(x_{i1}, ..., x_{ik}\right)\parallel ^2 \right )\\ s.t.\ \ l_j \le x_j \le \mu_{j}xmin​21​i∑​τi​(∥fi​(xi1​,...,xik​)∥2)s.t.  lj​≤xj​≤μj​

表达式 τi(∥fi(xi1,…,xik)∥2)\tau _{i}\left(\left\|f_{i}\left(x_{i_{1}}, \ldots, x_{i_{k}}\right)\right\|^{2}\right)τi​(∥fi​(xi1​​,…,xik​​)∥2) 在 Ceres 中是一个 ResidualBlock ,其中 fi(⋅)f_{i}(\cdot)fi​(⋅) 在 Ceres 中是一个 CostFunction ,它的计算又需要 xijx_{ij}xij​ 这些参数的参与, [xi1,…,xik]\left[x_{i_{1}}, \ldots, x_{i_{k}}\right][xi1​​,…,xik​​] 统称一个参数块。在大多数优化问题中,小组标量一起出现。例如,平移向量的三个分量和定义相机姿态的四元数的四个分量。我们将这样一组小标量称为 ParameterBlock。当然 ParameterBlock 也可以只有一个分量。ljl_{j}lj​ and uju_{j}uj​ 是参数块 xjx_{j}xj​ 的上下界。 τi\tau _{i}τi​ 是一个 Lossfunction。它是一个标量函数,用于减小非线性优化问题中的异常值对优化的影响。

在特殊情况下,当 τi(x)=x\tau _{i}(x)=xτi​(x)=x,是一个恒等映射,并且 lj=−∞l_{j}=-\inftylj​=−∞ and uj=∞u_{j}=\inftyuj​=∞ 我们就能得到常见的非线性优化问题形式如下:

12∑i∥fi(xi1,…,xik)∥2\frac{1}{2} \sum_{i}\left\|f_{i}\left(x_{i_{1}}, \ldots, x_{i_{k}}\right)\right\|^{2}21​i∑​∥fi​(xi1​​,…,xik​​)∥2
Solving Non-linear Least Squares