Academic
  • Introduction
  • Artificial Intelligence
    • Introduction
    • AI Concepts, Terminology, and Application Areas
    • AI: Issues, Concerns and Ethical Considerations
  • Biology
    • Scientific Method
    • Chemistry of Life
    • Water, Acids, Bases
    • Properties of carbon
    • Macromolecules
    • Energy and Enzymes
    • Structure of a cell
    • Membranes and transport
    • Cellular respiration
    • Cell Signaling
    • Cell Division
    • Classical and molecular genetics
    • DNA as the genetic material
    • Central dogma
    • Gene regulation
  • Bioinformatics
    • Bioinformatics Overview
  • Deep Learning
    • Neural Networks and Deep Learning
      • Introduction
      • Logistic Regression as a Neural Network
      • Python and Vectorization
      • Shallow Neural Network
      • Deep Neural Network
    • Improving Deep Neural Networks
      • Setting up your Machine Learning Application
      • Regularizing your Neural Network
      • Setting up your Optimization Problem
      • Optimization algorithms
      • Hyperparameter, Batch Normalization, Softmax
    • Structuring Machine Learning Projects
    • Convolutional Neural Networks
      • Introduction
    • Sequence Models
      • Recurrent Neural Networks
      • Natural Language Processing & Word Embeddings
      • Sequence models & Attention mechanism
  • Linear Algebra
    • Vectors and Spaces
      • Vectors
      • Linear combinations and spans
      • Linear dependence and independence
      • Subspaces and the basis for a subspace
      • Vector dot and cross products
      • Matrices for solving systems by elimination
      • Null space and column space
    • Matrix transformations
      • Functions and linear transformations
      • Linear transformation examples
      • Transformations and matrix multiplication
      • Inverse functions and transformations
      • Finding inverses and determinants
      • More Determinant Depth
  • Machine Learning
    • Introduction
    • Linear Regression
      • Model and Cost Function
      • Parameter Learning
      • Multivariate Linear Regression
      • Computing Parameters Analytically
      • Octave
    • Logistic Regression
      • Classification and Representation
      • Logistic Regression Model
    • Regularization
      • Solving the Problem of Overfitting
    • Neural Networks
      • Introduction of Neural Networks
      • Neural Networks - Learning
    • Improve Learning Algorithm
      • Advice for Applying Machine Learning
      • Machine Learning System Design
    • Support Vector Machine
      • Large Margin Classification
      • Kernels
      • SVM in Practice
  • NCKU - Artificial Intelligence
    • Introduction
    • Intelligent Agents
    • Solving Problems by Searching
    • Beyond Classical Search
    • Learning from Examples
  • NCKU - Computer Architecture
    • First Week
  • NCKU - Data Mining
    • Introduction
    • Association Analysis
    • FP-growth
    • Other Association Rules
    • Sequence Pattern
    • Classification
    • Evaluation
    • Clustering
    • Link Analysis
  • NCKU - Machine Learning
    • Probability
    • Inference
    • Bayesian Inference
    • Introduction
  • NCKU - Robotic Navigation and Exploration
    • Kinetic Model & Vehicle Control
    • Motion Planning
    • SLAM Back-end (I)
    • SLAM Back-end (II)
    • Computer Vision / Multi-view Geometry
    • Lie group & Lie algebra
    • SLAM Front-end
  • Python
    • Numpy
    • Pandas
    • Scikit-learn
      • Introduction
      • Statistic Learning
  • Statstics
    • Quantitative Data
    • Modeling Data Distribution
    • Bivariate Numerical Data
    • Probability
    • Random Variables
    • Sampling Distribution
    • Confidence Intervals
    • Significance tests
Powered by GitBook
On this page
  • Axis-Angle
  • Group
  • Definition of Group
  • Lie Group
  • Lie Algebra
  • Lie Group vs. Lie Algebra
  • Perturbation Model

Was this helpful?

  1. NCKU - Robotic Navigation and Exploration

Lie group & Lie algebra

PreviousComputer Vision / Multi-view GeometryNextSLAM Front-end

Last updated 5 years ago

Was this helpful?

還記得我們要求 Graph Optimization for 2D Pose 的時候,需要計算 rotation

這個 Rotation 在 2D 時可以用 θ\thetaθ 簡單表示就好,但在 3D 時會變得非常複雜,且無法簡單求導數 (原因是 rotation matrix 是無法使用加法運算的)

換句話說,在 3D 時我們只可以在 manifold space 解決 rotation matrix 的最佳化

Rotation 有很多種表達方式

  • Rotation matrix

  • Euler Angles

  • Axis-angle

  • Quaternion

  • Etc.

Axis-Angle

用 Axis-angle 舉例,定義旋轉軸 ω\omegaω 跟旋轉角度 θ=∥ω⃗∥\theta = \lVert \vec{\omega}\rVertθ=∥ω∥

其中 r′r'r′ 是 rrr 延著旋轉軸 ω\omegaω 進行 θ\thetaθ 度旋轉後的向量,可拆成平行和垂直於 ω\omegaω 的向量 (水平不會改變,可以沿用舊的)

最後可以得到 rodrigues rotation 公式: 在 axis-angle 下用舊的向量來取得新的旋轉向量

Group

把所有合法的 rotation matrix 集合起來稱為 Special Orthogonal Group (SO),其中 R 要是 orthogonal 且 det = 1

例如當 R 在三維空間時為 SO(3):

SO(3)={R∈R3×3∣RRT=I,det⁡(R)=1}SO(3) = \left\{ \mathbf{R}\in \mathbb{R}^{3\times3} \mid \mathbf{RR^T = I}, \det(\mathbf{R}) = 1 \right\}SO(3)={R∈R3×3∣RRT=I,det(R)=1}

當你不只描述 rotation 還想描述 translation 時就要加入 t

因為連續的轉換太麻煩,用更簡潔的方式 T 來表達整個 transformation

[a′1]=[Rt0T1][a1]=defT[a1]\begin{bmatrix} \mathbf{a}' \\1 \end{bmatrix} = \begin{bmatrix} \mathbf{R} & \mathbf{t} \\ 0^T & 1\end{bmatrix} \begin{bmatrix} \mathbf{a}\\ 1\end{bmatrix} \overset{\mathrm{def}}{=} \mathbf{T}\begin{bmatrix} \mathbf{a} \\ 1\end{bmatrix}[a′1​]=[R0T​t1​][a1​]=defT[a1​]

合法的 T 一樣可以組成 group,稱為 Special Euclidean group (SE),必須滿足 R 在 SO 且 t 為合法向量

例如當 T 在三維空間時為 SE(3):

SE(3)={T=[Rt0T1]∈R4×4∣R∈SO(3),t∈R3}SE(3) = \left\{ T = \begin{bmatrix} \mathbf{R} & \mathbf{t} \\ 0^T & 1\end{bmatrix} \in \mathbb{R}^{4\times 4} \mid \mathbf{R} \in SO(3), t\in \mathbb{R}^3 \right\}SE(3)={T=[R0T​t1​]∈R4×4∣R∈SO(3),t∈R3}

Definition of Group

Group 的基本定義,必須滿足以下四點:

  • closure: 進行 binary operation 還在同空間

  • identity

  • inverse

  • associativity: 結合律

因為用簡單的三維矩陣來表達 rotation matrix,加法不滿足 group 的定義,無法進行導數,所以必須尋找替代方案

Lie Group

Lie Group 裡的每個元素都是連續的,要解 manifold space 的最佳化,就要了解 lie group 和 mapping 對應的 lie algebra

現在有一個任意的 rotation matrix 滿足 orthogonal (RRT=I\mathbf{RR^T = I}RRT=I),且跟著時間 t 改變 (R(t)\mathbf{R(t)}R(t))

我們發現對 R(t)R(t)T=I\mathbf{R(t)R(t)^T = I}R(t)R(t)T=I 中的 t 做導數,會得到一個反對稱矩陣

  • ∧\wedge∧ 代表建構反對稱 (antisymmetric) 矩陣

  • ∨\vee∨ 代表從反對稱矩陣中,推回三維向量矩陣

a∧=A=[0−a3a2a30−a1−a2a10],A∨=a=[a1a2a3]\mathbf{a}^{\wedge} = \mathbf{A} = \begin{bmatrix} 0 & -a_3 & a_2 \\ a_3 & 0 & -a_1 \\ -a_2 & a_1 & 0\end{bmatrix}, \quad \mathbf{A}^{\vee} = \mathbf{a} = \begin{bmatrix} a_1 \\ a_2 \\ a_3\end{bmatrix}a∧=A=​0a3​−a2​​−a3​0a1​​a2​−a1​0​​,A∨=a=​a1​a2​a3​​​

對 t 做導數,得到的反對稱矩陣記為 Φ(t)\Phi(t)Φ(t)

R˙(t)R(t)T=Φ(t)∧\dot{\mathbf{R}}(t) \mathbf{R}(t)^{\mathrm{T}}=\Phi(t)^{\wedge}R˙(t)R(t)T=Φ(t)∧

可以從 ϕ(t)\phi(t)ϕ(t) 推回得到 R(t)\mathbf{R(t)}R(t) 的一階導數結果

R˙(t)=ϕ(t)∧R(t)=[0−ϕ3ϕ2ϕ30−ϕ1−ϕ2ϕ10]R(t)\dot{\mathbf{R}}(t)=\boldsymbol{\phi}(t)^{\wedge} \mathbf{R}(t)=\left[\begin{array}{ccc} 0 & -\phi_{3} & \phi_{2} \\ \phi_{3} & 0 & -\phi_{1} \\ -\phi_{2} & \phi_{1} & 0 \end{array}\right] \mathbf{R}(t)R˙(t)=ϕ(t)∧R(t)=​0ϕ3​−ϕ2​​−ϕ3​0ϕ1​​ϕ2​−ϕ1​0​​R(t)

而 ϕ(t0)\phi(t_0)ϕ(t0​) 其實就是 SO(3) 在原點附近的正切空間

Lie Algebra

ϕ(t0)=ϕ0R˙(t)=ϕ(t)∧R(t)=ϕ0∧R(t)\boldsymbol{\phi}\left(t_{0}\right)=\boldsymbol{\phi}_{0} \quad \dot{\mathbf{R}}(t)=\boldsymbol{\phi}(t)^{\wedge} \mathbf{R}(t)=\boldsymbol{\phi}_{0}^{\wedge} \mathbf{R}(t)ϕ(t0​)=ϕ0​R˙(t)=ϕ(t)∧R(t)=ϕ0∧​R(t)

因為知道怎麼求 R(t) 微分,就可以求 R(t)

R(t)=exp⁡(ϕ0∧t)\mathbf{R(t)} = \exp (\boldsymbol{\phi}^\wedge_0 t)R(t)=exp(ϕ0∧​t)

很多個 Φ\PhiΦ 可以組成 Lie algebra,這些 Φ\PhiΦ 必須可以形成反對稱矩陣

Φ=ϕ∧=[0−ϕ3ϕ2ϕ30−ϕ1−ϕ2ϕ10]∈R3×3sd(3)={ϕ∈R3,Φ=ϕ∧∈R3×3}\begin{aligned} &\Phi=\phi^{\wedge}=\left[\begin{array}{ccc} 0 & -\phi_{3} & \phi_{2} \\ \phi_{3} & 0 & -\phi_{1} \\ -\phi_{2} & \phi_{1} & 0 \end{array}\right] \in \mathbb{R}^{3 \times 3}\\ &\mathfrak{s} \mathfrak{d}(3)=\left\{\boldsymbol{\phi} \in \mathbb{R}^{3}, \boldsymbol{\Phi}=\boldsymbol{\phi}^{\wedge} \in \mathbb{R}^{3 \times 3}\right\} \end{aligned}​Φ=ϕ∧=​0ϕ3​−ϕ2​​−ϕ3​0ϕ1​​ϕ2​−ϕ1​0​​∈R3×3sd(3)={ϕ∈R3,Φ=ϕ∧∈R3×3}​

Lie algebra 代表的就是 Lie group 的切線空間,也要滿足一些特性,其中的 binary operation 為 Lie bracket (外積可以是其中一種)

  • closure

  • bilinearity

  • alternativity

  • jacobi identity

對 Lie algebra 中由 Φ\PhiΦ 而來的反對稱矩陣 A 取 exp 就可以對應回 lie group 的某個 R

exp⁡(A)=∑n=0∞=1n!An\exp(A) = \sum_{n=0}^\infty = \frac{1}{n!}A^nexp(A)=n=0∑∞​=n!1​An

這個對 A 取 exp 就像在 Axis-Angle 的 Rodrigues Rotation 一樣在做 rotation 的描述

Lie Group vs. Lie Algebra

  • Rotation matrix 是特殊的 lie group

  • Rotation matrix 會有一個對應的 lie algebra (R的切線空間)

  • 可以用 exponential, logarithmic 來做 mapping

  • 上圖顯示 lie group, lie algebra 的對應關係

  • Lie group = manifold space

  • 沿著時間 rotation 會不斷改變

  • 在時間 t 可以找到切平面 ϕ\phiϕ (lie algebra 裡的一個元素)

  • 用 ϕ\phiϕ 求反對稱矩陣,就能求得新的 rotation matrix

Perturbation Model

因為對 lie algebra 求導太複雜,有比較簡單的做法稱為 perturbation model

最後可以得到更新 R 的方法

Rnew=exp⁡(ψ∧)RinitR_{\text{new}} = \exp(\psi^{\wedge}) R_{\text{init}}Rnew​=exp(ψ∧)Rinit​