Skip to content

cosine_attention

allennlp.modules.attention.cosine_attention

[SOURCE]


CosineAttention

@Attention.register("cosine")
class CosineAttention(Attention)

Computes attention between a vector and a matrix using cosine similarity.

Registered as an Attention with name "cosine".