I have saved vectors in Weaviate that I want to query using dot product. I'm using the python sdk and I just don't see anyway of specifying this. Does anyone know if this is possible/not possible?
Does weaviate support dot product similarity when using the python sdk
303 Views Asked by Funzo At
1
There are 1 best solutions below
Related Questions in WEAVIATE
- Weaviate Cloud Service (WCS) Pricing
- Handling Varying Vector Sizes in Weaviate Indexing: Ensuring Consistency and Error Prevention
- Connect to Weaviate Database results in Key Error
- Migrate references from one collection to other in weaviate
- Weaviate cloud exceptions error: WeaviateStartUpError
- Failed while setting weaviate vector db Multi node cluster using docker swarm on 2 VMs
- Is it possible to filter objects in Weaviate based on an operator that compares two properties?
- Weaviate Gives Rate Limit Error while adding objects
- How to find similar words in Weaviate database
- Spring AI similarity search fails with Weaviate vector store
- tls: failed to verify certificate: x509: certificate signed by unknown authority when I use text2vec-openai module in weaviate docker container
- Weaviate Delete Batch Failing with Single ID Mapping Error
- How can I improve security for Weaviate in local environment?
- Edit weaviate modules once it's running on AWS
- Over Memory consumption of Weaviate
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular # Hahtags
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Hi and thanks for your question.
The simple answer as of writing this is "not yet, but soon", but I think I need to elaborate a bit to explain more.
Distance Functions
Generally, distance functions in Weaviate are entirely pluggable. Anything that can produce a score can be plugged in. For example, see this folder. In fact, you will even see a file named
dot_product.goin there. This is because internally for calculating the cosine sim, Weaviate will normalize all vectors on read and then just calculate the dot product.APIs
So, if Weaviate can calculate the dot product why can't you select this option? This is because of a past decision to introduce the
certaintyfield in the API. This field is used to return scores and to limit results by score. The original idea behind the certainty was that we would want a single metric that can produce a number between0and1to indicate the distance. With cosine sim that's simple, as this is already in the range of-1, 1, so it's very easy to transform it into a certainty. With an unbounded score such as dot product, this isn't so easy.Path forward
Here is a discussion on this topic. Feel free to participate in this discussion. The current favorite option is to deprecate
certaintyand expose the raw values as eitherscoreordistance.Any quickfixes?
We could easily enable new distance scores, such as dot product before the above mentioned API issue is solved. Possibly as an experimental feature using a feature flag. However, you would not be able to see the resulting scores/distances in the APIs.
Timelines
I expect the above mentioned issue to be resolved in a couple of weeks as of writing this (April 28, 2022).