当前位置:网站首页>The method to measure the similarity of two vectors: cosine similarity, pytorch calculate cosine similarity: torch nn. CosineSimilarity(dim=1, eps=1e-08)
The method to measure the similarity of two vectors: cosine similarity, pytorch calculate cosine similarity: torch nn. CosineSimilarity(dim=1, eps=1e-08)
2022-07-01 03:33:00 【It's seventh uncle】
more than string phase like degree \color{red}{ Cosine similarity } more than string phase like degree
stay NLP In my mission , Will calculate the similarity of the generated two word vectors , Cosine similarity formula is often used to calculate .
Cosine similarity uses the cosine value of the angle between two vectors in vector space to measure the difference between two individuals . The closer the cosine is to 1, It means that the closer the angle is 0 degree , That is, the more similar the two vectors are , This is called " Cosine similarity ".
We know , For two vectors , If the angle between them is smaller , So we think the more similar these two vectors are . Cosine similarity is the use of this theoretical idea . It measures the similarity between vectors by calculating the cosine of the angle between two vectors .
The formula is as follows :
Reference resources : A way to measure the similarity between two vectors : Cosine similarity
be used for torch Cosine similarity function :
pytorch Cosine similarity :torch.nn.CosineSimilarity(dim=1, eps=1e-08)
边栏推荐
- ES6解构语法详解
- 衡量两个向量相似度的方法:余弦相似度、pytorch 求余弦相似度:torch.nn.CosineSimilarity(dim=1, eps=1e-08)
- Data exchange JSON
- Detailed list of errors related to twincat3 ads of Beifu
- How do I use Google Chrome 11's Upload Folder feature in my own code?
- C语言多线程编程入门学习笔记
- Detailed explanation of ES6 deconstruction grammar
- pytorch nn. AdaptiveAvgPool2d(1)
- 4、【WebGIS实战】软件操作篇——数据导入及处理
- ECMAScript 6.0
猜你喜欢

CX5120控制汇川IS620N伺服报错E15解决方案

Kmeans

C语言多线程编程入门学习笔记

Develop industrial Internet with the technical advantages of small programs

jeecgboot输出日志,@Slf4j的使用方法

Listener listener

IPv4 and IPv6, LAN and WAN, gateway, public IP and private IP, IP address, subnet mask, network segment, network number, host number, network address, host address, and IP segment / number - what does

EDLines: A real-time line segment detector with a false detection control翻译

Ctfshow blasting WP

过滤器 Filter
随机推荐
Split(), split(), slice(), can't you tell?
Pathmeasure implements loading animation
ECMAScript 6.0
Detailed explanation of ES6 deconstruction grammar
Edge drawing: a combined real-time edge and segment detector
Md5sum operation
Avalanche problem and the use of sentinel
TEC: Knowledge Graph Embedding with Triple Context
The combination of applet container technology and IOT
Force buckle - sum of two numbers
HTB-Lame
打包iso文件的话,怎样使用hybrid格式输出?isohybrid:command not found
Server rendering technology JSP
Leetcode:剑指 Offer 59 - I. 滑动窗口的最大值
JUC学习
EtherCAT简介
Feature Pyramid Networks for Object Detection论文理解
E15 solution for cx5120 controlling Huichuan is620n servo error
ES6解构语法详解
过滤器 Filter