matlab 求矩阵距离,matlab 计算大型距离方阵,distance matrix | 学步园

利用vlfeat工具包可行。

网址见:http://www.vlfeat.org/matlab/vl_alldist2.html

返回: pairwise distance matrix D of the columns of S1 and S2, yielding

D = VL_ALLDIST2(X,Y) returns the pairwise distance matrix D of the columns of S1 and S2, yielding

D(i,j) = sum (X(:,i) - Y(:,j)).^2

VL_ALLDIST2(X) returns the pairwise distance matrix fo the columns of S, yielding

D(i,j) = sum (X(:,i) - X(:,j)).^2

VL_ALLDIST2(...,'METRIC') changes the computed distance. Supported values for METRIC are

METRIC D(i,j)

--------------------------------------------------------

LINF max |X - Y|

L2 sum (X - Y).^2

L1 sum |X - Y|

L0 sum (X ~= Y)

CHI2 sum (X - Y).^2 ./ (X + Y)

HELL sum (X^.5 - Y^.5) .^ 2

(Notice that the standard definition of chi2 is half of what is computed here).

VL_ALLDIST2(...,'KERNEL') computes the following 'kernels' K:

KERNEL K(i,j)

---------------------------------------------------------

KL2 sum X .* Y

KL1 sum min (X, Y)

KCHI2 2 * sum (X .* Y) ./ (X + Y)

KHELL (X .* Y) .^ 0.5

The constant are chosen so that D(i,j) = K(i,i) + K(j,j) - 2 K(i,j) where D is the metric corresponding to the kenrel (if the arguments are non-negative vectors). Each kernel can be interpreted as the inner product inducing the corresponding metric in an embedding

of the real space into an approrpiate reproducing Kenrel Hilbert space.

VL_ALLDIST2() supports several storage classes. X and Y must have the same storage class. The sotrage class of D is promoted to reduce the chance of overvlow,

but this is not checked.

转自:http://www.vlfeat.org/matlab/vl_alldist2.html

http://www.vlfeat.org/matlab/matlab.html

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值