Internal order: close in direction and possibly in reverse by length

Two vectors of internal volume are equal to the respective parameters multiplied by the cosine of the corner.

Thematic shorts • IntroductionCollate in 1 diagram2 self-measured2 First-hand sources
Start Body
Learning objectives and first steps2 objectives 2 first fixes

Try to do it after reading

  • Disaggregate directions and parameters in the internal volume
  • Determining whether search targets need to be unitized

Suggested first

  • Inner vectors & Parameters
  • Classified loss and gradient

The inner build-up looks both at angle and length

Two vectors of internal volume are equal to the respective parameters multiplied by the cosine of the corner. When checking a fixed number, the candidate parameters still affect the ranking. Maximum internal search is not equal to maximum cosine search unless the conditions for assimilation are met. The length of the candidate vector may raise scores even if the direction is not closer.

Query q = [10], candidate A = [0.8, 0.6], paradigm 1, cosine 0.8; Candidate B = [2,2] with a range of about 2.828 and a cosine of about 0.707. Inner volume A for 0.8, B for 2, and selection of B; Cosine selects A. There is no contradiction between the two indicators, which optimize different definitions of similarities.

Normalization of the query will not change the internal order of the query, as all candidate scores are divided by one positive. To move from internal accumulation to cosine, there is also a need for candidate unitization. When each query has a different length, the reclassification of the query changes the comparability of cross-check scores, but this is another issue.

It could be a signal, or it could be a deviation

Some training targets give higher parameters to high frequency or high confidence candidates. Unitization may reduce the impact if the mission wishes to retain this preference; If only a semantic orientation is desired, the parameters may lead to a popular bias. The relation of the parameters to frequency, length, label should be checked and selected through downstream assessment.

Training and services must be aligned. (a) Cosine training is conducted using unredified internal indexes and targets are not matched; The sudden grouping of the models after the original in-house training also changes the order of the models learned. You cannot switch distance types at random on the index layer and interpret them only by “achieving faster”.

Numerical diagnosis can construct a pool of candidates in the same direction but in different lengths. If similar similarities are expected, the original internal volume will be exposed to uncertainty. It is also possible to establish a constant paradigm to gradually change the angle and to distinguish which portion of geometric information the model is using.

This section is based on the built-in equation Faiss The official distance agreement. A 、 B is the synthetic two-dimensional vector. Each coordinates embedded in the high-width are usually without direct business implications and should not be directly derived from the parameter difference from the user value or from the difference in the value of the logarithm causal effect 。

The inner volume is different from the cosineQuery along horizontal axes, A It's coming in closer. B Larger and more horizontally projectedq=[1,0]A=[0.8,0.6]B=[2,2](b) A measurement of direction and length, respectively; The plot axis is used only for illustrative purposes.
The values are compared to the body: internal selection B, cosine selection A.

Value recovery

import math
q=[1,0]; a=[0.8,0.6]; b=[2,2]
dot=lambda x,y:sum(u*v for u,v in zip(x,y))
cos=lambda x,y:dot(x,y)/math.sqrt(dot(x,x)*dot(y,y))
assert dot(q,b)>dot(q,a)
assert cos(q,a)>cos(q,b)
Can the original internals be sorted into cosine sorting only by stats?

No, the candidate criteria still exist; The uniform scaling of fixed queries does not change the sequence of candidates.

In the example, who chooses the inner and cosine?

(a) An internal selection B, 2 > 0.8; Cosine selection A, 0.8 is greater than about 0.707.

Sources and reconciliations

Definitions, methods and interfaces are available.

  1. Faiss — MetricType and distances
  2. Sentence-BERT: Sentence Embeddings using Siamese BERT-Networks

Figures and calculations are reorganized according to this chapter. Mathematical measurements, framework operations and real business effects are described separately in the body of the text.

← Back to the knowledge directory
Ask Max Ask about this site
Ask Max ↗

Opening the assistant…

Paper figure

Photo comments

LEAVE A NOTE

About this photograph

Connecting to the discussion board…

    Comments become public after moderation. You can delete your own comments from this browser.
    No email is required. Clearing cookies prevents this browser from claiming earlier comments.

    MAX WANG / INDEX

    Find something

    Enter a keyword, or explore the directory below.