Home > Software engineering >  In Tensorflow, how can I create a new tensor from a cosine similarity operation?
In Tensorflow, how can I create a new tensor from a cosine similarity operation?

Time:12-18

I'm trying to create an output tensor with dimensionality 32 x 576 x 2 from an operation between matrices M and X, with the following shapes:

M.shape: (576, 2, 2048)
X.shape: (32, 2048)

The operation I'm defining is an element-wise cosine similarity, from the following equation:

enter image description here

which represents the cosine similarity between the feature vector

  • Related