[X=left|
egin{matrix}
x_{11} & x_{12} & cdots & x_{1d}\
x_{21} & x_{22} & cdots & x_{2d}\
vdots & vdots & ddots & vdots \
x_{11} & x_{12} & cdots & x_{1d}\
end{matrix}
ight|
]
[egin{matrix}
1 & x & x^2\
1 & y & y^2\
1 & z & z^2\
end{matrix}
]
[left{
egin{array}{c}
a_1x+b_1y+c_1z=d_1\
a_2x+b_2y+c_2z=d_2\
a_3x+b_3y+c_3z=d_3
end{array}
ight}
]
[X=egin{pmatrix}
0&1&1\
1&1&0\
1&0&1\
end{pmatrix}
]
1. 希腊字母表
Sigma:
(Sigma)
2. 上下标、根号、省略号
下标:_
x^2
(Longrightarrow) $ x^2$上标:^
x_i
(Longrightarrow) (x_i)根号:sqrt |
ysqrt{x}
(Longrightarrow) (ysqrt{x})省略号:
dots
(Longrightarrowdots)
cdots
(Longrightarrowcdots)
ddots
(Longrightarrowddots)括号
3. 运算符
- 求和:
sum_1^n
(Longrightarrow) (sum_1^n)- 积分:
int_1^n
(Longrightarrow) (int_1^n)- 极限:
lim_{x o infty}
(Longrightarrow) (lim_{x o infty})- 分数:
frac{2}{3}
(Longrightarrow) $frac{2}{3} $
4. 箭头
leftarrow
对应 (leftarrow)
5. 分段函数
f(n)=
egin{cases}
n/2, & ext{if $n$ is even}\
3n+1,& ext{if $n$ is odd}
end{cases}
[f(n)=
egin{cases}
n/2, & ext{if $n$ is even}\
3n+1,& ext{if $n$ is odd}
end{cases}
]
6. 方程组
left.
left{
egin{array}{c}
a_1x+b_1y+c_1z=d_1\
a_2x+b_2y+c_2z=d_2\
a_3x+b_3y+c_3z=d_3
end{array}
ight.
ight>
[left.
left{
egin{array}{c}
a_1x+b_1y+c_1z=d_1\
a_2x+b_2y+c_2z=d_2\
a_3x+b_3y+c_3z=d_3
end{array}
ight.
ight>
]
7.矩阵
7.1 基本语法
- 起始标记
egin{matrix}
,结束标记end{matrix}
- 每一行末尾标记
\
- 行间元素之间用
&
分隔。
egin{matrix}
0&1&1\
1&1&0\
1&0&1\
end{matrix}
[egin{matrix}
0&1&1\
1&1&0\
1&0&1\
end{matrix}
]
7.2 矩阵边框
- 在起始、结束标记用下列词替换
matrix
pmatrix
:小括号边框bmatrix
:中括号边框Bmatrix
:大括号边框vmatrix
:单竖线边框Vmatrix
:双竖线边框
egin{vmatrix}
0&1&1\
1&1&0\
1&0&1\
end{vmatrix}
[egin{vmatrix}
0&1&1\
1&1&0\
1&0&1\
end{vmatrix}
]
7.3 省略元素
- 横省略号:
cdots
- 竖省略号:
vdots
- 斜省略号:
ddots
egin{bmatrix}
{a_{11}}&{a_{12}}&{cdots}&{a_{1n}}\
{a_{21}}&{a_{22}}&{cdots}&{a_{2n}}\
{vdots}&{vdots}&{ddots}&{vdots}\
{a_{m1}}&{a_{m2}}&{cdots}&{a_{mn}}\
end{bmatrix}
[egin{bmatrix}
{a_{11}}&{a_{12}}&{cdots}&{a_{1n}}\
{a_{21}}&{a_{22}}&{cdots}&{a_{2n}}\
{vdots}&{vdots}&{ddots}&{vdots}\
{a_{m1}}&{a_{m2}}&{cdots}&{a_{mn}}\
end{bmatrix}
]
7.4 阵列
- 需要array环境:起始、结束处以{array}声明
- 对齐方式:在{array}后以{}逐行统一声明
- 左对齐:
l
居中:c
右对齐:r
- 竖直线:在声明对齐方式时,插入
|
建立竖直线- 插入水平线:
hline
egin{array}{c|lll}
{↓}&{a}&{b}&{c}\
hline
{R_1}&{c}&{b}&{a}\
{R_2}&{b}&{c}&{c}\
end{array}
[egin{array}{c|lll}
{↓}&{a}&{b}&{c}\
hline
{R_1}&{c}&{b}&{a}\
{R_2}&{b}&{c}&{c}\
end{array}
]
- 需要array环境:起始、结束处以{array}声明
7.5 等号上下文字
arrowname[sub-script]{super-script}
- arrowname具体见下面,等号名称
- sub-script 代表等号下面内容
- super-script 代表等号上面内容
8.常用公式
8.1 线性模型
h( heta) = sum_{j=0} ^n heta_j x_j
[h( heta) = sum_{j=0} ^n heta_j x_j
]
8.2 均方误差
J( heta) = frac{1}{2m}sum_{i=0}^m(y^i - h_ heta(x^i))^2
[J( heta) = frac{1}{2m}sum_{i=0}^m(y^i - h_ heta(x^i))^2
]
8.3 求积
H_c=sum_{l_1+dots +l_p}prod^p_{i=1} inom{n_i}{l_i}
[H_c=sum_{l_1+dots +l_p}prod^p_{i=1} inom{n_i}{l_i}
]
8.4 批梯度下降
egin{align}
frac{partial J( heta)}{partial heta_j}
& = -frac1msum_{i=0}^m(y^i - h_ heta(x^i)) frac{partial}{partial heta_j}(y^i-h_ heta(x^i))\
& = -frac1msum_{i=0}^m(y^i-h_ heta(x^i)) frac{partial}{partial heta_j}(sum_{j=0}^n heta_j x^i_j-y^i)\
&=-frac1msum_{i=0}^m(y^i -h_ heta(x^i)) x^i_j
end{align}
[frac{partial J( heta)}{partial heta_j} = -frac1msum_{i=0}^m(y^i - h_ heta(x^i))x^i_j
]
[egin{align}
frac{partial J( heta)}{partial heta_j}
& = -frac1msum_{i=0}^m(y^i - h_ heta(x^i)) frac{partial}{partial heta_j}(y^i-h_ heta(x^i))\
& = -frac1msum_{i=0}^m(y^i-h_ heta(x^i)) frac{partial}{partial heta_j}(sum_{j=0}^n heta_j x^i_j-y^i)\
&=-frac1msum_{i=0}^m(y^i -h_ heta(x^i)) x^i_j
end{align}
]