Skip to content

issue regarding stats #3449

Closed
Closed
@anupsingh15

Description

@anupsingh15

Hello,

I am implementing the HNSW index on a dummy dataset. I want to know how many exact distance computations are performed during the search. To do so, I use faiss.cvar.hnsw_stats.ndis; however, it always returns 0. Could you tell me how to fix the issue?

Code:

x = np.random.randn(10000,128)
M=32
index_hnsw = faiss.IndexHNSWFlat(128, M)            
index_hnsw.hnsw.efConstruction = 40        
index_hnsw.hnsw.efSearch = 16   
index_hnsw.add(x)

D, I = index_hnsw.search(x[:10], 2)
cands = faiss.cvar.hnsw_stats.ndis #total cands evaluated across all queries

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions