avatar
Articles
24
Tags
0
Categories
7

首页
时间轴
分类
Notes
Search
首页
时间轴
分类

Notes

optim
Created2022-09-23|数据科学
优化器更新参数机制 Require: 初始化参数 $\theta$ Require: 学习率 $\epsilon$ while 没有达到停止准则 do      计算梯度估计:  $\boldsymbol{g} \leftarrow \frac{1}{m} \nabla_{\boldsymbol{\theta}} \sum_{i} L\left(f\left(\boldsymbol{x}^{(i)} ; \boldsymbol{\theta}\right), \boldsymbol{y}^{(i)}\right)$      计算一阶动量、二阶动量:  $s=\phi(g)$ 、$r=\psi(g)$      计算更新:  $\Delta \theta = \epsilon \cdot s / r$      应用更新:  $\theta = \theta + \Delta \theta$ SGD / SGD with momentum / SGD with Nesterov 用法 weight_decay - L2正则化 momentum - 一阶动量权重系数 damp ...
loss
Created2022-09-23|数据科学
CrossEntropyLoss 熵 熵即一个事件所包含的信息量 $$ s(x)=-\sum_{i} P\left(x_{i}\right) \log {b} P\left(x{i}\right) $$ KL散度 KL散度可用来描述两个分布的距离,KL散度不具备有对称性。 KL散度的定义 对于离散分布 $$ D_{K L}(A | B)=\sum_{i} P_{A}\left(x_{i}\right) \log \left(\frac{P_{A}\left(x_{i}\right)}{P_{B}\left(x_{i}\right)}\right)=\sum_{i} P_{A}\left(x_{i}\right) \log \left(P_{A}\left(x_{i}\right)\right)-P_{A}\left(x_{i}\right) \log \left(P_{B}\left(x_{i}\right)\right) $$ 对于连续分布 $$ D_{K L}(A | B)=\int a(x) \log \left(\frac{a(x)}{b(x)}\right) $$ K ...
lstm
Created2022-09-23|数据科学
LSTM $$ \begin{array}{ll} \ i_t = \sigma(W_{ii} x_t + b_{ii} + W_{hi} h_{t-1} + b_{hi}) \ f_t = \sigma(W_{if} x_t + b_{if} + W_{hf} h_{t-1} + b_{hf}) \ g_t = \tanh(W_{ig} x_t + b_{ig} + W_{hg} h_{t-1} + b_{hg}) \ o_t = \sigma(W_{io} x_t + b_{io} + W_{ho} h_{t-1} + b_{ho}) \ c_t = f_t \odot c_{t-1} + i_t \odot g_t \ h_t = o_t \odot \tanh(c_t) \ \end{array} $$
激活函数汇总
Created2022-09-21|数据科学
Sigmoid 函数 $$ \sigma(x) = \frac{1}{1 + e^{-x}} $$ 导数 $$ \sigma’(x) = \sigma(x)\cdot(1-\sigma(x)) $$ 优点 函数是可微的。 梯度平滑。 Sigmoid 函数的输出范围是 0 到 1,因此它对每个神经元的输出进行了归一化,课用于将预测概率作为输出的模型。 缺点 激活函数计算量大(在正向传播和反向传播中都包含幂运算和除法) 不是zero-centered 梯度消失 Tanh 函数 $$ \tau(x) = \tanh(x) = \frac{e^{x} - e^{-x}}{e^{x} + e^{-x}} $$ 导数 $$ \tau’(x) = 1 - \tau^{2}(x) $$ 优点 zero-centered 相比sigmoid梯度消失有所改善 梯度更大,容易收敛 缺点 梯度消失 ReLu 函数 $$ \sigma(x) = max(0, x) $$ 导数 $$ \sigma’(x) = \left\lbrace \begin{array}{cl} ...
123
avatar
EeyoreLee
Articles
24
Tags
0
Categories
7
Follow Me
Recent Post
Git2024-12-25
记:一次接口性能优化(cpu模型推理 + ES)2024-08-22
PagedAttention2024-08-20
KV Cache2024-07-10
闭包2024-01-02
Categories
  • C++1
  • Linux1
  • Python3
  • 强化学习1
  • 数据科学15
  • 数据结构与算法1
  • 运维1
Archives
  • December 20241
  • August 20242
  • July 20241
  • January 20241
  • December 20231
  • October 20232
  • September 20231
  • August 20231
Info
Article :
24
UV :
PV :
Last Update :
©2020 - 2025 By EeyoreLee
Framework Hexo|Theme Butterfly
Search
Loading the Database