12(10−x)2.
the cost function also known as residual .
cost function 就是残差的意思啦。

不知道为什么定义这个cost functor 为10 -x
input the cost functor and out put cost function
costfunction we may not know 这个cost function 是ceres定义的? 我不清楚 helloworld
2那个自动求导和解析微分我没看懂
3.鲍威尔法,这个原理得看下最优化书才懂,代码实现使用轮子看起来挺简单
dense QR QR分解用一个半正交矩阵和上三角矩阵的积求解
4.curve fitting
y=e0.3x+0.1y=e0.3x+0.1
这个是初始function 加上个gaussian sample 出一堆数据
然后用y=emx+c. 来拟合
struct ExponentialResidual { ExponentialResidual(double x, double y) : x_(x), y_(y) {} template <typename T> bool operator()(const T* const m, const T* const c, T* residual) const { residual[0] = T(y_) - exp(m[0] * T(x_) + c[0]); return true; } private: // Observations for a sample. const double x_; const double y_; };
这个residual 表示蛮搞的
| // Data generated using the following octave code. | |
| // randn('seed', 23497); | |
| // m = 0.3; | |
| // c = 0.1; | |
| // x=[0:0.075:5]; | |
| // y = exp(m * x + c); | |
| // noise = randn(size(x)) * 0.2; | |
| // y_observed = y + noise; | |
| // data = [x', y_observed']; |
adding Gaussian noise with standard deviation σ=0.2σ=0.2. Let us fit some data to the curve
这个是用octave 生成的 randn(size(x))就是返回一个与x同样维数的随机数组
本文介绍了Ceres优化库的应用,包括成本函数的概念及其定义方式,使用鲍威尔法进行优化的原理,以及通过曲线拟合的实际案例说明如何利用Ceres解决实际问题。
642

被折叠的 条评论
为什么被折叠?



