با مجموعهها، منظم بمانید
ذخیره و طبقهبندی محتوا براساس اولویتهای شما.
در تصویر بالا، اگر می خواهید b بیشتر شبیه a باشد تا c ، کدام معیار را باید انتخاب کنید؟
محصول نقطه ای
درسته! حاصل ضرب نقطه ای متناسب با کسینوس و طول بردارها است. بنابراین حتی اگر کسینوس برای زاویه تشکیل شده توسط b و c بیشتر از زاویه تشکیل شده توسط b و a باشد، طول برداری بزرگتر a باعث می شود حاصل ضرب نقطه ای a و b بزرگتر از حاصل ضرب نقطه ای b و c باشد.
کسینوس
کسینوس فقط به زاویه بین بردارها و زاویه کوچکتر بستگی دارد \(\theta_{bc}\) می سازد \(\cos(\theta_{bc})\) بزرگتر از \(\cos(\theta_{ab})\).
فاصله اقلیدسی
فاصله \(\vec{bc}\) کوچکتر از \(\vec{ab}\)، b را به c نزدیکتر می کنیم تا a .
شما شباهت را برای موزیک ویدیوها محاسبه می کنید. طول وکتورهای جاسازی شده موزیک ویدیوها متناسب با محبوبیت آنها است. برای محاسبه شباهت، از کسینوس به حاصل نقطه تغییر می کنید. شباهت بین موزیک ویدیوها چگونه تغییر می کند؟
ویدیوهای محبوب به طور کلی شبیه همه ویدیوها می شوند.
از آنجایی که محصول نقطه ای تحت تأثیر طول هر دو بردار قرار می گیرد، طول برداری بزرگ ویدیوهای محبوب باعث می شود که آنها بیشتر به همه ویدیوها شبیه شوند.
ویدیوهای پرطرفدار فقط شبیه سایر ویدیوهای محبوب می شوند.
به یاد بیاورید که حاصل ضرب نقطه به صورت محاسبه می شود \(|a||b|\cos(\theta)\). با فرض اینکه a یک موزیک ویدیوی محبوب است، ما مدت زمان جاسازی آن را می دانیم، \(|a|\)، بزرگتر از ویدیوهای ناپسند است. طول بزرگتر، محصول نقطه را بدون توجه به مقدار آن افزایش می دهد \(|b|\). از این رو، ویدیوهای پرطرفدار بیشتر شبیه همه ویدیوهای دیگر می شوند، نه فقط ویدیوهای محبوب دیگر.
ویدیوهای پرطرفدار نسبت به ویدیوهای کمتر محبوب کمتر به یکدیگر شبیه می شوند.
از آنجایی که محصول نقطه با طول برداری افزایش مییابد، و ویدیوهای محبوب دارای طول برداری بالایی هستند، اندازهگیری شباهت افزایش مییابد نه کاهش.
بدون تغییر.
محصول نقطه ای تحت تأثیر طول برداری قرار می گیرد. طول برداری بالای ویدیوهای محبوب، معیار شباهت (که قبلا کسینوس بود) را تغییر میدهد.
با توجه به تنظیمات مشابه سؤال قبلی، فرض کنید از محصول نقطهای به کسینوس برمیگردید. شباهت بین موزیک ویدیوها چگونه تغییر می کند؟
ویدیوهای پرطرفدار کمتر شبیه همه ویدیوها می شوند.
از آنجایی که کسینوس تحت تأثیر طول برداری قرار نمی گیرد، طول بردار زیاد جاسازی های ویدیویی محبوب به شباهت کمک نمی کند. بنابراین، تغییر به کسینوس از محصول نقطهای، شباهت بین ویدیوهای محبوب و سایر ویدیوها را کاهش میدهد.
ویدیوهای محبوب به همه ویدیوها شبیه تر می شوند.
کسینوس تحت تأثیر طول های برداری قرار نمی گیرد، بنابراین تغییر از محصول نقطه ای باعث کاهش شباهت های همه ویدیوهای محبوب می شود.
ویدیوهای پرطرفدار فقط به یکدیگر شبیه می شوند.
کسینوس تحت تأثیر طول های برداری قرار نمی گیرد، بنابراین تغییر از محصول نقطه ای باعث کاهش شباهت های همه ویدیوهای محبوب می شود.
بدون تغییر.
از آنجایی که کسینوس تحت تأثیر طول برداری قرار نمی گیرد، در حالی که حاصل ضرب نقطه ای تحت تأثیر قرار می گیرد، تغییر از حاصل ضرب نقطه ای به کسینوس شباهت ها را تغییر می دهد.
تاریخ آخرین بهروزرسانی 2025-02-25 بهوقت ساعت هماهنگ جهانی.
[null,null,["تاریخ آخرین بهروزرسانی 2025-02-25 بهوقت ساعت هماهنگ جهانی."],[[["\u003cp\u003eDot product considers both angle and magnitude of vectors, making vectors with larger magnitudes more similar despite the angle between them.\u003c/p\u003e\n"],["\u003cp\u003eCosine similarity only considers the angle between vectors, disregarding their magnitudes.\u003c/p\u003e\n"],["\u003cp\u003eSwitching from cosine to dot product for similarity calculation makes popular items (with larger vector magnitudes) more similar to all other items.\u003c/p\u003e\n"],["\u003cp\u003eSwitching back from dot product to cosine similarity normalizes the effect of magnitude, making popular items less biased towards similarity with all other items.\u003c/p\u003e\n"]]],[],null,["# Check your understanding\n\nIn the image above, if you want `b` to be more similar to `a` than to `c`, which measure should you pick? \nDot product \nCorrect! The dot product is proportional to both the cosine and the lengths of vectors. So even though the cosine is higher for the angle formed by `b` and `c` than for the angle formed by `b` and `a`, the greater vector length of `a` makes the dot product of `a` and `b` greater than the dot product of `b` and `c`. \nCosine \nThe cosine depends only on the angle between vectors, and the smaller angle \\\\(\\\\theta_{bc}\\\\) makes \\\\(\\\\cos(\\\\theta_{bc})\\\\) larger than \\\\(\\\\cos(\\\\theta_{ab})\\\\). \nEuclidean distance \nThe distance \\\\(\\\\vec{bc}\\\\) is smaller than \\\\(\\\\vec{ab}\\\\), leaving `b` closer to `c` than to `a`. \nYou are calculating similarity for music videos. The length of the embedding vectors of music videos is proportional to their popularity. You switch from cosine to dot product to calculate similarity. How does similarity between music videos change? \nPopular videos become **more similar** to all videos in general. \nSince the dot product is affected by the lengths of both vectors, the large vector length of popular videos will make them more similar to all videos. \nPopular videos only become **more similar** to other popular videos. \nRecall that the dot product is calculated as \\\\(\\|a\\|\\|b\\|\\\\cos(\\\\theta)\\\\). Assuming `a` is a popular music video, we know its embedding length, \\\\(\\|a\\|\\\\), is larger than that of unpopular videos. The larger length increases the dot product irrespective of the value of \\\\(\\|b\\|\\\\). Hence, popular videos become more similar to all other videos, not just other popular videos. \nPopular videos become **less similar** to each other than to less popular videos. \nSince dot product increases with vector length, and popular videos have high vector length, the similarity measure will increase, not decrease. \nNo change. \nDot product is affected by vector length. The high vector length of popular videos will change the (previously cosine) similarity measure. \nGiven the same setup as the previous question, suppose you switch back to cosine from dot product. How does similarity between music videos change? \nPopular videos become **less similar** to all videos. \nBecause cosine is not affected by vector length, the large vector length of popular video embeddings does not contribute to similarity. Thus, switching to cosine from dot product reduces the similarity between popular videos and all other videos. \nPopular videos become **more similar** to all videos. \nCosine is not affected by the vector lengths, so switching from dot product will cause the similarities for all popular videos to decrease. \nPopular videos become **more similar** only to each other. \nCosine is not affected by the vector lengths, so switching from dot product will cause the similarities for all popular videos to decrease. \nNo change. \nSince cosine is not affected by vector length, while dot product is, switching from dot product to cosine will change similarities."]]