Skip to content

Some questions about hybrid search, WeightedRanker and COSINE score #34415

Discussion options

You must be logged in to vote

Q1
The doc mentioned "For instance, the distance for IP ranges from [-∞,+∞], while the distance for L2 ranges from [0,+∞]. Milvus employs the arctan function, transforming values to the [0,1] range to provide a standardized basis for different metric types.".
Arctan is for IP and L2 whose range is unlimited(∞).
COSINE range is [-1, 1], is limited, the (1 + distance) * 0.5 makes sense.

        if isCosine {
		f := func(distance float32) float32 {
			return (1 + distance) * 0.5
		}
		return f
	}

	if isIP {
		f := func(distance float32) float32 {
			return 0.5 + float32(math.Atan(float64(distance)))/math.Pi
		}
		return f
	}

	f := func(distance float32) float32 {
		return 1.0 - 2*float32(m…

Replies: 3 comments 6 replies

Comment options

You must be logged in to vote
1 reply
@LoveFishoO
Comment options

Answer selected by LoveFishoO
Comment options

You must be logged in to vote
5 replies
@yhmo
Comment options

@LoveFishoO
Comment options

@LoveFishoO
Comment options

@yhmo
Comment options

@LoveFishoO
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants