Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/bojone/attention
/ functions
Functions
35 in github.com/bojone/attention
⨍
Functions
35
◇
Types & classes
8
↓ 12 callers
Method
reuse
(self, layer, *args, **kwargs)
attention_keras.py:40
↓ 9 callers
Function
Dense
(inputs, ouput_size, bias=True, seq_len=None)
attention_tf.py:47
↓ 6 callers
Method
__init__
(self, heads, size_per_head, key_size=None, mask_right=False, **kwargs)
attention_keras.py:69
↓ 6 callers
Method
build
(self, input_shape)
attention_keras.py:77
↓ 6 callers
Function
to_mask
通用mask函数 这里的mask.shape=[batch_size, seq_len]或[batch_size, seq_len, 1]
attention_keras.py:7
↓ 5 callers
Function
extract_seq_patches
x.shape = [None, seq_len, seq_dim] 滑动地把每个窗口的x取出来,为做局部attention作准备。
attention_keras.py:22
↓ 3 callers
Function
Mask
(inputs, seq_len, mode='mul')
attention_tf.py:30
↓ 1 callers
Method
call
(self, inputs)
attention_keras.py:82
↓ 1 callers
Method
idx2pos
(self, pid)
attention_keras.py:459
Function
Attention
(Q, K, V, nb_head, size_per_head, Q_len=None, V_len=None)
attention_tf.py:65
Function
Position_Embedding
(inputs, position_size)
attention_tf.py:9
Method
__init__
(self, heads, size_per_head, key_size=None, mask_right=False, **kwargs)
attention_keras.py:133
Method
__init__
(self, heads, size_per_head, rate=1, key_size=None, mask_right=False, **kwargs)
attention_keras.py:168
Method
__init__
(self, heads, size_per_head, neighbors=1, rate=1, key_size=None, mask_right=False, **kwargs)
attention_keras.py:229
Method
__init__
(self, heads, size_per_head, rate=2, key_size=None, mask_right=False, **kwargs)
attention_keras.py:290
Method
__init__
(self, maxlen, v_dim, merge_mode='add', **kwargs)
attention_keras.py:399
Method
__init__
(self, v_dim, merge_mode='add', **kwargs)
attention_keras.py:438
Method
build
(self, input_shape)
attention_keras.py:141
Method
build
(self, input_shape)
attention_keras.py:177
Method
build
(self, input_shape)
attention_keras.py:239
Method
build
(self, input_shape)
attention_keras.py:301
Method
build
(self, input_shape)
attention_keras.py:405
Method
call
(self, inputs)
attention_keras.py:149
Method
call
(self, inputs)
attention_keras.py:185
Method
call
(self, inputs)
attention_keras.py:252
Method
call
(self, inputs)
attention_keras.py:306
Method
call
允许传入r(当前位置id)来得到相对位置向量
attention_keras.py:412
Method
call
允许传入r(当前位置id)来得到相对位置向量
attention_keras.py:443
Method
compute_output_shape
(self, input_shape)
attention_keras.py:126
Method
compute_output_shape
(self, input_shape)
attention_keras.py:157
Method
compute_output_shape
(self, input_shape)
attention_keras.py:217
Method
compute_output_shape
(self, input_shape)
attention_keras.py:278
Method
compute_output_shape
(self, input_shape)
attention_keras.py:389
Method
compute_output_shape
(self, input_shape)
attention_keras.py:428
Method
compute_output_shape
(self, input_shape)
attention_keras.py:469