This repo provides pytorch code which replicates the results of the Matching Networks for One Shot Learning paper on the Omniglot and MiniImageNet dataset
we could calculate cosine similarity with following succinct code:
cosine_similarity = F.cosine_similarity(support_image, target_set)
where F is imported as torch.nn.functional
In the source code, the author calculates the cosine distance as follows.
But in my opinion, the right the cosine distance should be calculated as follows.
Am i right? If not, what is the mistake?