I have different types of attention mechanisms. (one-directional, bi-directional etc)
similar to

  
      arxiv.org
  
  
    
1502.03044.pdf 1

9.14 MB

  
  
    
    
  
  


Mostly, they create an affinity matrix with M x N (M = sequence length of X, N = sequence length of Y) by a dot (vector) product between X & Y and use this affinity matrix to summarise X and/or Y.