在Tensorflow的Luong Attention的得分函数中 有代码(github link):
# batched matmul on:
# [batch_size, 1, depth] . [batch_size, depth, max_time]
# resulting in an output shape of:
# [batch_size, 1, max_time]
query = array_ops.expand_dims(query, 1)
score = math_ops.matmul(query, keys, transpose_b=True)
score = array_ops.squeeze(score, [1])
我假设 Tensorflow的代码实现了Luong出版物中的点得分功能?
如果这是正确的-通用得分函数(如上所示)使用权重Wa只是将ht缩放为hs(如果这两个形状不同)?