Skip to content

Commit

Permalink
update 1-flat example
Browse files Browse the repository at this point in the history
  • Loading branch information
briangu committed Dec 21, 2023
1 parent 40dcb87 commit cf44586
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/faiss/1-flat.kg
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@
d::64 :" dimension "
nb::100000 :" database size "
nq::10000 :" nb of queries "
rns(1234) :" make reproducible "
rns(1234) :" make reproducible "

xb::rna(nb,d)
xq::rna(nq,d)

index::IndexFlatL2(d);add::.pya(index;"add");search::.pya(index;"search")
.p(.pya(index,"is_trained"))
.p(.pya(index;"is_trained"))
add(xb)
.pya(index;"ntotal")
.p(.pya(index;"ntotal"))

k::4
DI::search(5#xb;k)
Expand Down
13 changes: 13 additions & 0 deletions examples/faiss/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Setup:

CPU:

```
pip3 install faiss-cpu
```

GPU:

```
pip3 install faiss-cpu
```

0 comments on commit cf44586

Please sign in to comment.