Skip to content

Instantly share code, notes, and snippets.

View lirenlin's full-sized avatar

Renlin Li lirenlin

View GitHub Profile
@lirenlin
lirenlin / levmarq - Levenberg-Marquardt in plain C
Created January 25, 2019 18:08 — forked from rbabich/ levmarq - Levenberg-Marquardt in plain C
A simple implementation of the Levenberg-Marquardt algorithm in plain C
This file (with a leading space) exists so that the gist has a sensible name, rather than "LICENSE."
@lirenlin
lirenlin / slam.md
Last active December 18, 2018 13:59
方差, 协方差, 信息矩阵, Jacobian矩阵, Hessian矩阵

The gradient is a vector-valued function, as opposed to a derivative, which is scalar-valued.

In some applications it is customary to represent the gradient as a row vector or column vector of its components in a rectangular coordinate system.

  • muti-variable function
    • scalar-valued function: Rn -> R, gradient vector, row matrix or column matrix.
      f(x1, x2 ... xn):
Euclidean space
Cartesian coordinate system
manifolds
@lirenlin
lirenlin / gist:ba0bf1ea44a1ad3b17c815d96428d074
Created December 18, 2018 09:54
解析解, 数值解
解析解,又稱為閉式解,是可以用解析表達式來表達的解。 在数学上,如果一个方程或者方程组存在的某些解,是由有限次常见运算的組合给出的形式,则称该方程存在解析解。
二次方程的根就是一个解析解的典型例子。在低年级数学的教学当中,解析解也被称为公式解。
当解析解不存在时,比如五次以及更高次的代数方程,则该方程只能用数值分析的方法求解近似值。大多數偏微分方程,尤其是非线性偏微分方程,都只有數值解。
@lirenlin
lirenlin / slam.md
Last active December 17, 2018 23:53

滤波器模型 1, 假设了马尔科夫性, 当前状态只跟上一个时候状态有关 2, 线性高斯假设 --》 卡尔曼滤波器模型

线性高斯系统: 运动方程, 观测方程都可以由线性来描述, 并假设所有的运动和观测噪声都满足高斯分布
xk = Ak*xk-1 + uk + wk
zk = Ck*xk + vk
wk ~ N (0, R)\

@lirenlin
lirenlin / MAP.markdown
Last active December 17, 2018 22:06
likelihood, posterior probablity, prior probabliy

MLE: 最大似然概率 给定测量结果, 系统模型, 寻求系统模型参数让结果跟观测结果最贴近。

似然函数(也称作似然),是一个关于统计模型参数的函数。也就是这个函数中自变量是统计模型的参数。对于观测结果 x ,在参数集合 θ 上的似然,就是在给定这些参数值的基础上,观察到的结果的概率 P(x|θ) 。也就是说,似然是关于参数的函数,在参数给定的条件下,对于观察到的 x 的值的条件分布。

MAP: 最大后验概率 考虑到先验概率的存在 prior probability

theta` = argmax P(theta|x) = P(x|theta) * p(theta) / p(x)

@lirenlin
lirenlin / gist:6172b343dbfd0d0a561a4c1b192da7ba
Created November 12, 2018 18:17
RPO, pre-order, post-order
tree vs graph
in tree, every node has a single predecessor, could have multiple sucessors.
in graph, there is no limitation, multiple predecessors, multiple sucessors.
RPO in graph, ensures all predecessors are visited before the current node is visited. Topologic sorting, forward data flow analysis.
RPO is the same as pre-order in tree, but different in graph.
post-order ensures all sucessors are visited before current node is visited. This is the reverse of RPO. backward data analysis.
.ssh/config
Host *
ForwardAgent yes
eval `ssh-agent -s`
ssh-add
ssh -A xx@xxx
https://stackoverflow.com/questions/17846529/could-not-open-a-connection-to-your-authentication-agent
position independent executable: executable
position independent code: shared object/library
PIE is to support address space layout randomization (ASLR) in executable files.
static pie: executable without external dependency of shared library or dynamic linker.
It should be able to self-relocate itself.
There must be a entry point stub which only use pc relative addressing.