faiss 简介
安装方式
1 | # cpu 版本 |
Index 介绍
- 以
IndexFlatL2和IndexFlatIP为例展示其使用方式。其他的index使用参考链接。
| Method | Class name | index_factory |
Main parameters | Bytes/vector | Exhaustive | Comments |
|---|---|---|---|---|---|---|
| Exact Search for L2 | IndexFlatL2 |
"Flat" |
d |
4*d |
yes | brute-force |
| Exact Search for Inner Product | IndexFlatIP |
"Flat" |
d |
4*d |
yes | also for cosine (normalize vectors beforehand) |
- 常用的距离度量
cosine,但是使用之前需要进行normalize,否则不会生效。