Files

26 lines
1.0 KiB
Markdown
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Neural Network and Deep Learning
## Logistic Regression
$$\begin{align}
正向传递\\
z &= w^Tx + b \\
a &= \sigma(z) = \frac{1}{1+e^{-x}} \\
\hat{y} &= L(a) = -ylog(\hat{y}) - (1-y)log(1-\hat{y}) \ \ 其中(\hat{y} = a) \\
反向传递 \\
\frac{dL}{da} &= \frac{(a-y)}{a(1-a)} \\
\frac{da}{dz} &= a(1-a) \\
dz = \frac{dL}{dz} &= \frac{dL}{da} \cdot \frac{da}{dz} = a-y \\
dw = \frac{dL}{dw} &= \frac{dL}{dz} \cdot \frac{dz}{dw} = xdz \\
db = \frac{dL}{db} &= \frac{dL}{dz} \cdot \frac{dz}{db} = dz \\
w &= w - \eta \cdot dw \\
b &= b - \eta \cdot db
\end{align}$$
正向传递:计算网络输出。
反向传递:更新模型参数。
sigmoid函数消除线性。
> 线性激活函数: $a = z$
> 如果我们使用线性激活函数,无论我们经过多少层网络迭代,都相当于是对输入进行线性变换。
损失函数:计算模型预测结果的精度,反向传播的目的就是使得。
## Vectorization
向量化相较于显式循环更高效,能够更好的利用系统的并行化计算。