How to modify (override) kmeans centroids and do inference #3683
Replies: 2 comments
-
|
What do you mean with "inference" ? |
Beta Was this translation helpful? Give feedback.
-
|
Thanks for the reply I will look into the page, but meanwhile I figured as a solution to reset the kmean.index and add the centroids, then search in it Is there any important difference between the two methods? |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Summary
I'm a newbie with FAISS, but it works nicely.
Maybe I'm not 100% into it yet, so sorry if my questions are silly.
I would like to train a k-mean, do inference, make some maths on the centroids and redo inference without retraining.
Which is the best way to do it?
Reproduction instructions
Here's the importat part of my class:
Then in the main code:
However looking at #1940 and https://gist.github.com/mdouze/9eb96d941c94ef59482a069e5862a650 I have the impression that I do not really update the index.
Should be something like this?
self.clustering.kmeans.index.add(centroids2)new_data_kmeans2, _ = self.clustering.val_kmean(new_data)but how to override the old centroids?
Running on:
Interface:
Beta Was this translation helpful? Give feedback.
All reactions