Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bojone/attention
/ types & classes
Types & classes
8 in github.com/bojone/attention
⨍
Functions
35
◇
Types & classes
8
↓ 3 callers
Class
Attention
多头注意力机制
attention_keras.py:66
Class
AtrousSelfAttention
空洞多头自注意力机制 说明:每个元素只跟相对距离为rate的倍数的元素有关联。
attention_keras.py:164
Class
LocalSelfAttention
局部多头自注意力机制 说明:每个元素只跟相对距离不超过neighbors的元素有关联,这里的rate 是真正的膨胀率(跟膨胀卷积一样),如果不了解可以忽略,默认为1就好。
attention_keras.py:224
Class
OurLayer
定义新的Layer,增加reuse方法,允许在定义Layer时调用现成的层
attention_keras.py:37
Class
SelfAttention
多头自注意力机制
attention_keras.py:130
Class
SinCosPositionEmbedding
Google提出来的Sin-Cos形式的位置Embedding
attention_keras.py:435
Class
SparseSelfAttention
稀疏多头自注意力机制 来自文章《Generating Long Sequences with Sparse Transformers》 说明:每个元素只跟相对距离为rate的倍数的元素、以及相对距离不超过rate的元素有关联。
attention_keras.py:285
Class
TrainablePositionEmbedding
定义位置Embedding,直接训练出来
attention_keras.py:396