title
stringlengths
12
112
published
stringlengths
19
23
url
stringlengths
28
28
video_id
stringlengths
11
11
channel_id
stringclasses
5 values
id
stringlengths
16
31
text
stringlengths
0
596
start
float64
0
37.8k
end
float64
2.18
37.8k
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t730.0
So if we are multiplying our dimensionality value d by 8 in order to get a good recall
730
743.2
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t738.32
then if we have a dimensionality of 4 that's not a very high number so it's going to be
738.32
752.4
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t743.2
reasonably fast but if we increase that to dimensionality for example 512 that becomes
743.2
757.16
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t752.4000000000001
very, very complex very quickly.
752.4
759.64
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t757.1600000000001
So you have to be careful with your dimensionality.
757.16
763.44
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t759.6400000000001
Lower dimensionality is very good for LSH otherwise it's not so good.
759.64
770.84
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t763.44
You can see that here so at the bottom here I've used this is on the same data set so
763.44
778.16
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t770.84
an n bits value of d multiplied by 2 with LSH it's super fast.
770.84
785.2
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t778.1600000000001
It's faster than our flat index which is what you would hope but if we increase the n bits
778.16
794.18
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t785.2
value quite a bit so maybe you want very high performance then it gets out of hand very
785.2
798.4
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t794.1800000000001
quickly and our search time just grows massively.
794.18
803.16
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t798.4
So you kind of have to find that balance but what we got before was pretty good.
798.4
810.2
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t803.16
We had a d multiplied by 4 I think and we got reasonable performance and it was fast
803.16
812.48
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t810.1999999999999
so it's good.
810.2
817.88
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t812.48
And that also applies to the index size as well so lower n bits size index size isn't
812.48
819.26
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t817.88
too bad.
817.88
828.2
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t819.26
With higher n bits it's pretty huge so also something to think about.
819.26
833.1
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t828.2
Now let's move on to HNSW.
828.2
841.92
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t833.1
Now HNSW is what first part of it is NSW which is Navigo Small World Graphs.
833.1
850.88
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t841.9200000000001
Now what makes a graph small world it essentially means that this graph can be very large but
841.92
856.08
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t850.88
the number of hops so the number of steps you need to take between any two vertexes
850.88
864
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t856.08
which is the points is very low so in this example here we have this vertex over here
856.08
880.2
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t864.0
and to get over to this one on the opposite side we need to take 1, 2, 3, 4 hops and this
864
885.72
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t880.2
is obviously a very small network so it doesn't really count but you can see this sort of
880.2
895.2
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t885.72
behaviour in very large networks so I think in 2016 there was a study from Facebook and
885.72
900.36
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t895.2
at that point I don't remember the exact number of people that they had on the platform but
895.2
908.8
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t900.36
I think it's in the billions and they found that the average number of hops that you need
900.36
915.56
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t908.8000000000001
to take between any two people on the platform is like 3.6 so that's a very good example
908.8
919.46
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t915.56
of a Navigo Small World Graph.
915.56
927.92
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t919.4599999999999
Now hierarchical NSW graphs which is what we are using they're built in the same way
919.46
932.92
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t927.92
like a NSW graph but then they're split across multiple layers which is what you can see
927.92
942.68
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t932.92
here and when we are performing our search the path it takes will hop between different
932.92
946.92
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t942.68
layers in order to find our nearest neighbour.
942.68
953.24
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t946.92
Now it's pretty complicated and this is really I think over simplifying it a lot but that's
946.92
959.4
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t953.2399999999999
the general gist of it I'm not going to go any further into it we will I think in a future
953.24
961.86
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t959.4
video and article.
959.4
969.16
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t961.8599999999999
Now let's put that together in code.
961.86
976.78
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t969.16
So we have a few different variables here we have M which I'm going to set to 16 and
969.16
985.28
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t976.78
M is the number of connections that each vertex has so of course that means greater connectivity
976.78
990
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t985.28
we're probably going to find our nearest neighbours more accurately.
985.28
996.48
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t990.0
EF search which is how what is the depth of our search every time we perform a search
990
1,004.96
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t996.48
so we can set this to a higher value if we want to search more the network or a low value
996.48
1,009.06
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1004.96
if we want to search less of the network obviously low values can be quicker high value can be
1,004.96
1,011.8
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1009.0600000000001
more accurate.
1,009.06
1,021.16
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1011.8000000000001
And then we have EF construction now this similar to EF search is how much of the network
1,011.8
1,029.78
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1021.16
will we search but not during the actual search during the construction of the network.
1,021.16
1,035.12
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1029.78
So this is essentially how efficiently and accurately are we going to build the network
1,029.78
1,038.4
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1035.12
in the first place.
1,035.12
1,045
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1038.3999999999999
So this will increase the add time but the search time it makes no difference on so it's
1,038.4
1,053
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1045.0
good to use a high number I think for this one.
1,045
1,063.08
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1053.0
So initialise our index and we have is FICE index HNSW flat so we can use different vectors
1,053
1,071.64
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1063.08
here that we can I think PQ PQ there and essentially what that's going to do is make this search
1,063.08
1,075.72
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1071.64
faster but slightly less accurate.
1,071.64
1,079.78
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1075.72
Now this is already really fast with flats and that's all we're going to stick with but
1,075.72
1,085.62
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1079.7800000000002
again like I said we will return to this at some point in future and cover it in a lot
1,079.78
1,087.92
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1085.6200000000001
more detail for sure.
1,085.62
1,093.28
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1087.92
So dimensionality we need to pass in our M value here as well.
1,087.92
1,103.52
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1093.28
Now we want to apply those two parameters so we have EF search which is obviously EF
1,093.28
1,113.24
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1103.52
search and then we also have HNSW the obviously the EF construction.
1,103.52
1,123.2
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1113.24
So that should be everything ready to go and all we want to do now is add our data.
1,113.24
1,127.52
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1123.2
So index.add WB.
1,123.2
1,132.56
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1127.52
Okay now like I said we have that EF construction we use a reasonably high value so you can
1,127.52
1,139.72
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1132.56
see this is already taking a lot longer than the previous indexes to actually add our vectors
1,132.56
1,144.8
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1139.72
into it but it's still not going to take that long.
1,139.72
1,151.32
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1144.8
And then once it is done we are going to do our search just like we did every other time
1,144.8
1,165.16
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1151.32
so we have DI equals search sorry index.search and we are going to pass in our query and
1,151.32
1,166.16
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1165.1599999999999
also K.
1,165.16
1,173.48
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1166.1599999999999
Okay so 43.6 seconds to add the vectors there so a fair bit longer but then look at this
1,166.16
1,178.2
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1173.48
super fast like that 3.7 milliseconds.
1,173.48
1,185.96
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1178.2
So much faster than the last one I think the last one was 16 milliseconds right.
1,178.2
1,197.12
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1185.96
Okay this is a flat index 157 LSH we have 17.6 okay so really quick which is cool.
1,185.96
1,206.06
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1197.1200000000001
But how's the performance so let's have a look.
1,197.12
1,212.12
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1206.06
Okay so we get quite a few false's here and only a couple of true's so okay it's not so
1,206.06
1,220.96
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1212.12
great it was really fast but it's not very accurate but fortunately we can fix that so
1,212.12
1,231.84
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1220.96
let's increase our EF search I'm going to increase it a fair bit let's go 32.32.
1,220.96
1,237.84
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1231.84
This is probably I would imagine more than enough to get good performance so run this
1,231.84
1,242.32
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1237.84
and run this.
1,237.84
1,245.84
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1242.32
Okay and now we see we get pretty good results.
1,242.32
1,249.84
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1245.84
Now the war time is higher so it's just a case of balancing it because this is now higher
1,245.84
1,257.72
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1249.84
than LSH but what we can do is increase EF construction time the value of EF construction
1,249.84
1,260.68
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1257.72
increases or decreases depending on what you want.
1,257.72
1,266.72
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1260.68
There's a lot of flexibility with this and it can be really fast this is HNSW is essentially
1,260.68
1,271.08
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1266.72
one of the best performing indexes that you can use if you look at the current state of
1,266.72
1,277.78
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1271.0800000000002
the art a lot of them are HNSW or they're based on HNSW in some way or another.
1,271.08
1,281.44
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1277.78
So these are good ones good ones to go with you just need to play around them a little
1,277.78
1,283.44
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1281.44
bit.
1,281.44
1,291.52
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1283.44
So this is a few of the performance I found using the same data set but I'm messing around
1,283.44
1,301.12
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1291.52
so we have the EF construction values down here so start with 16 over here up to 64 EF
1,291.52
1,306.52
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1301.1200000000001
search values over here and our M values over here.
1,301.12
1,312.92
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1306.52
And we've got pretty good recall over 64 on the EF construction so EF construction is
1,306.52
1,316.96
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1312.92
a really good one to just increase because it doesn't increase your search time which
1,312.92
1,320.8
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1316.96
is pretty cool I think.
1,316.96
1,328.24
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1320.8000000000002
And then here is the search time again for HNSW M and EF search obviously I didn't include
1,320.8
1,331.4
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1328.24
EF construction there because it doesn't make a difference.
1,328.24
1,338.96
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1331.4
And that's this is the one thing with HNSW the index size is absolutely huge so that's
1,331.4
1,346.32
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1338.96
just one thing to bear in mind the index size can take a lot of memory but otherwise really
1,338.96
1,349.36
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1346.32
really cool index.
1,346.32
1,357.34
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1349.3600000000001
And then that leaves us on to our final index which is the IVF index and this is super popular
1,349.36
1,361.1
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1357.3400000000001
and with good reasons it is very good.
1,357.34
1,370.6
Choosing Indexes for Similarity Search (Faiss in Python)
2021-08-09 15:04:10 UTC
https://youtu.be/B7wmo_NImgM
B7wmo_NImgM
UCv83tO5cePwHMt1952IVVHw
B7wmo_NImgM-t1361.1
So the inverted file index is based on essentially clustering data points so you see here we
1,361.1
1,376.72