MATLAB爱好者论坛-LabFans.com

MATLAB爱好者论坛-LabFans.com (https://www.labfans.com/bbs/index.php)
-   资料存档 (https://www.labfans.com/bbs/forumdisplay.php?f=72)
-   -   需要帮助了解此计算以计算2个向量之间的接近度 (https://www.labfans.com/bbs/showthread.php?t=22246)

poster 2019-11-28 18:40

需要帮助了解此计算以计算2个向量之间的接近度
 
我正在Coursera的机器学习课程中进行编程任务。我写了一个代码来计算向量grad 。他们已经实现了用于计算numgrad代码。根据作业,如果我的代码正确,则grad和numgrad应该非常接近。为此,他们编写了以下测试:

diff = norm(numgrad-grad)/norm(numgrad+grad);

浏览完文档后,我知道norm(numgrad-grad)将给出两个向量之间的欧几里得距离。因此,这不应该定义向量之间的紧密度吗?为什么我们将其除以norm(numgrad+grad) ?这代表什么?



[url=https://stackoverflow.com/q/59086838]更多&回答...[/url]


所有时间均为北京时间。现在的时间是 21:15

Powered by vBulletin
版权所有 ©2000 - 2025,Jelsoft Enterprises Ltd.