Machine Learning Andrew Ng -3. Linear Algebra review

3.1 Matrices and vectors

Matrix: Rectangular array of numbers. (A B C)

Dimension of matrix : number of rows x number of columns

Matrix Elements (entires of matrix) : A i j A_{ij}

Vector: An n x 1 matrix. (a, b, c)

1- indexed vs 0- indexed :

y=\left\lbrack\matrix{y_1\y_2\y_3\y_4}\right\rbrack vs y=\left\lbrack\matrix{y_0\y_1\y_2\y_3}\right\rbrack
又是一段CSDN显示不出来的公式…

在这里插入图片描述

we use 1- indexed

3.2 Addition and scalar multiplication(标量乘法)

3.3 Matrix-vector multiplication

House sizes : \matrix{2104 \ 1416\1532\852} \quad \quad h_{\theta}(x)=-40+0.25x
matrix : \left\lbrack\matrix{1 & 2104\1 & 1416\1&1532\1&852}\right\rbrack \times \left\lbrack\matrix{-40\0.25}\right\rbrack =
依旧显示不出来

在这里插入图片描述

3.4 Matrix-matrix multiplication

House sizes : \matrix{2104 \ 1416\1532\852}

在这里插入图片描述

  1. h θ ( x ) = 40 + 0.25 x \quad h_{\theta}(x)=-40+0.25x
  2. h θ ( x ) = 200 + 0.1 x \quad h_{\theta}(x)=200+0.1x
  3. h θ ( x ) = 150 + 0.4 x \quad h_{\theta}(x)=-150+0.4x

matrix : \left\lbrack\matrix{1 & 2104\1 & 1416\1&1532\1&852}\right\rbrack \times \left\lbrack\matrix{-40&200&-150\0.25&0.1&0.4}\right\rbrack =

在这里插入图片描述

3.5 Matrix multiplication properties

A × B B × A A\times B \neq B \times A

A × B × C = A × ( B × C ) = ( A × B ) × C A \times B \times C=A \times (B \times C)=(A \times B) \times C

Identity Matrix: I n × n I_{n\times n}

3.6 Inverse and transpose(逆和转置)

Matrices that don’t have an inverse are “singular” (奇异) or “degenerate” (退化)

发布了44 篇原创文章 · 获赞 0 · 访问量 1351

猜你喜欢

转载自blog.csdn.net/qq_41664688/article/details/103992044