Skip to main content

funkeras

Project description

notekeras

my blog

attention, transformer, bert 等都是从大神CyberZHG学习来的, 主要是因为想学习源码并进行一些标注,所以进行了一些翻译、标注和整合

yolo 参考 keras-yolo3, keras-yolo3

Attention

ScaledDotProductAttention

参考论文

$$\text{Attention}(Q, K, V) = \text{softmax}(\frac{Q K^T}{\sqrt{d_k}}) V$$

SeqSelfAttention

参考论文

multiplicative

$$e_{t, t'} = x_t^T W_a x_{t'} + b_a$$

$$a_{t} = \text{softmax}(e_t)$$

$$l_t = \sum_{t'} a_{t, t'} x_{t'}$$

additive

$$h_{t, t'} = \tanh(x_t^T W_t + x_{t'}^T W_x + b_h)$$

$$e_{t, t'} = W_a h_{t, t'} + b_a$$

$$a_{t} = \text{softmax}(e_t)$$

$$l_t = \sum_{t'} a_{t, t'} x_{t'}$$

SeqWeightedAttention

参考论文

$$Y = \text{softmax}(XW + b) X$$

MultiHeadAttention

参考论文

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

funkeras-0.8.12-py3-none-any.whl (268.2 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page