Alterna · learning material

13.3 Looking for the Next Directions

We're using a familiar comparison of vectors in Chapter 01. The calculation is done in full space, not in the distance of the picture.

What this material covers

Content and key concepts

On the previous page, how vector images change.
We're using a familiar comparison of vectors in Chapter 01. The calculation is done in full space, not in the distance of the picture.
Table E stores the coordinate line for each ID. These coordinates are taught. The familiar cosine is now used for the specific task of finding close representations.
Для изменения рисунка включитеJavaScript; расчёт и теория доступны далее.
Comparing vectors, not names
For the non-zero q,d cosine=qTd/(
In manual fixture, "cat"=[1,0.0], "dog"=, [9.1,0], fish=[0.0.1]. Cosine cat/dog=.9/G.82E.993884, cat/fish=0. This is a given geometry, not proof that the model itself has learned the proximity of animals.
Experiment.
Change the third co-ordinate of one candidate by observing the full 3Dscore. Then switch 2D projection of the graph. Ranking shouldn't count clandestinely at two visible coordinates. For the zero vector cosine, there is no defined; such candidate is marked separately, does not receive a fictional 0.
The length of q may contain information that the cosine deletes. Some tasks use dot, Euclidean dissance or trained metric. You can't consider cosines as a universal definition of meaning. The complete overtaking here is accurate and cheap; the ANN index for the large body is a separate engineering solution for the future RAG block.
from math import sqrt
similarity=.9/sqrt(.9**2+.1**2)
assert abs(similarity-.9938837346736189)<1e-12
The code repeats the operations just taken care of.
Completely checked Python-example Chapter
Available with a separate file; the short piece shown does not replace its implementation.
Visualization does not replace the original metric.
The figure shows only part of the space. How does this question continue the result?
Python examples of Chapter 13
Academic base

Textbook contents map