MCPcopy Create free account

hub / github.com/bojone/attention / functions

Functions35 in github.com/bojone/attention

↓ 12 callersMethodreuse
(self, layer, *args, **kwargs)
attention_keras.py:40
↓ 9 callersFunctionDense
(inputs, ouput_size, bias=True, seq_len=None)
attention_tf.py:47
↓ 6 callersMethod__init__
(self, heads, size_per_head, key_size=None, mask_right=False, **kwargs)
attention_keras.py:69
↓ 6 callersMethodbuild
(self, input_shape)
attention_keras.py:77
↓ 6 callersFunctionto_mask
通用mask函数 这里的mask.shape=[batch_size, seq_len]或[batch_size, seq_len, 1]
attention_keras.py:7
↓ 5 callersFunctionextract_seq_patches
x.shape = [None, seq_len, seq_dim] 滑动地把每个窗口的x取出来,为做局部attention作准备。
attention_keras.py:22
↓ 3 callersFunctionMask
(inputs, seq_len, mode='mul')
attention_tf.py:30
↓ 1 callersMethodcall
(self, inputs)
attention_keras.py:82
↓ 1 callersMethodidx2pos
(self, pid)
attention_keras.py:459
FunctionAttention
(Q, K, V, nb_head, size_per_head, Q_len=None, V_len=None)
attention_tf.py:65
FunctionPosition_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
Methodbuild
(self, input_shape)
attention_keras.py:141
Methodbuild
(self, input_shape)
attention_keras.py:177
Methodbuild
(self, input_shape)
attention_keras.py:239
Methodbuild
(self, input_shape)
attention_keras.py:301
Methodbuild
(self, input_shape)
attention_keras.py:405
Methodcall
(self, inputs)
attention_keras.py:149
Methodcall
(self, inputs)
attention_keras.py:185
Methodcall
(self, inputs)
attention_keras.py:252
Methodcall
(self, inputs)
attention_keras.py:306
Methodcall
允许传入r(当前位置id)来得到相对位置向量
attention_keras.py:412
Methodcall
允许传入r(当前位置id)来得到相对位置向量
attention_keras.py:443
Methodcompute_output_shape
(self, input_shape)
attention_keras.py:126
Methodcompute_output_shape
(self, input_shape)
attention_keras.py:157
Methodcompute_output_shape
(self, input_shape)
attention_keras.py:217
Methodcompute_output_shape
(self, input_shape)
attention_keras.py:278
Methodcompute_output_shape
(self, input_shape)
attention_keras.py:389
Methodcompute_output_shape
(self, input_shape)
attention_keras.py:428
Methodcompute_output_shape
(self, input_shape)
attention_keras.py:469