LoginSignup
0
1

More than 3 years have passed since last update.

【数学】similarity(類似度)を計算する時、Inner Product(内積)を使う理由

Last updated at Posted at 2020-12-09

Deep Learningで使われるSimilarityについて考える

DeepLearningの論文を読んでるとSimilarityを計算するのにInner Productが使われている場面を多々見かけます。

Stereo Depth EstimationにはCorrelation(相関性)という言葉で表されています。

私が思うに相関性を見るのに2つ方法があり、
1. 左右の特徴量を引き算の絶対値が0に近いとSimilarityが高い
2. Inner Productを使い値が大きいとSimilarityが高い

実験

subtract(引き算)のabsolute(絶対値)の場合
abs(0-0) = 0 / abs(0-1) = 1 / abs(1-0) = 1

Inner Product(内積)の場合
0x0 = 0 / 0x1 = 0 / 1x0 = 0

考察

Inner Productの場合、1方がとある特徴がなく、もう1方はとある特徴がある場合に相関関係が0になる事が見てわかります。
よってInner Productを使う事で特徴が似ている場合にのみ相関関係があると判断する事が出来ます

感想

最初は「引き算して絶対値が近ければSimilarity高いでしょ!」と思っていたのですが、
気づけば当たり前の事だったのですが、掛け算したほうが相関関係が分かるという事に気づきました。

高校で勉強したのですが、実践になって改めて理解出来ました。

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1