参考链接:
Faiss indexes · facebookresearch/faiss Wiki · GitHub
Faiss提供了多种索引,本篇介绍一些基础索引。
Method | Class name | index_factory | Main param | Exhaustive | Comments |
精确搜索--L2 | IndexFlatL2 | "Flat" | d--向量维数 | 是 | 暴力搜索 |
精确搜索--内积(IP) | IndexFlatIP | "Flat" | d | 是 | 也可以将向量标准化后使用cosine相似度 |
Hierarchical Navigable Small World(HNSW)图搜索 | IndexHNSWFlat | "HNSWx,Flat" | d | 否 | x表示构建图索引时每个节点最多连接多少个节点 |
倒排索引(IVF) | IndexIVFFlat | "IVFx,Flat" | quantize |