【文件属性】:
文件名称:keras-attention-mechanism-master:keras注意力机制
文件大小:1.14MB
文件格式:ZIP
更新时间:2021-05-11 05:54:52
Python
Keras注意机制
在Keras中为以下层实现了简单的关注机制:
密集(注意2D块)
LSTM,GRU(注意3D块)
示例:注意块
致密层
inputs = Input(shape=(input_dims,))
attention_probs = Dense(input_dims, activation='softmax', name='attention_probs')(inputs)
attention_mul = merge([inputs, attention_probs], output_shape=input_dims, name='attention_mul', mode='mul')
让我们考虑这个“ Hello World”示例:
32个值的向量v作为模型的输入(简单前馈神经网络)。
v [1] =目标。
目标是二进制(0或1)。
向量v的所有其他值(
【文件预览】:
keras-attention-mechanism-master-master
----attention_dense.py(2KB)
----attention_lstm.py(3KB)
----attention_utils.py(3KB)
----requirements.txt(60B)
----LICENSE(11KB)
----assets()
--------graph_single_attention.png(434KB)
--------lstm_after.png(46KB)
--------attention_1.png(211KB)
--------1.png(45KB)
--------lstm_before.png(50KB)
--------graph_multi_attention.png(427KB)
----README.md(5KB)
----.gitignore(1KB)