milvus-io / knowhere

Knowhere is an open-source vector search engine, integrating FAISS, HNSW, etc.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[bug]:[COSINE] metric_type cosine, GetVectorByIds returns the original vector, not normalized

elstic opened this issue · comments

commented

metric_type: COSINE

_, result_ids = knowhere.DataSetToArray(ans)
ids = knowhere.ArrayToDataSet(result_ids[2])
result, _ = idx.GetVectorByIds(ids, build_cfg)
raw_vec = knowhere.GetVectorDataSetToArray(result)
degraded += utils.verify_raw_vector(raw_vec, train_vec, result_ids[2])

image

commented

/assign @cydrain

which index type ? @elstic

commented

which index type ? @elstic

HNSW 、IVF_FLAT

@elstic we are expecting for original index right?

which index type ? @elstic

HNSW 、IVF_FLAT

it's impossible, please check if the original dataset is already normalized.

commented

@elstic we are expecting for original index right?

Currently metric_type cosine does not support GetVectorByIds, @cydrain support and then return to verify the test here

HNSW + COSINE can support GetVectorByIds now, but IVF_FLAT still not.
please re-test this case.
@elstic

commented

HNSW + COSINE can support GetVectorByIds now, but IVF_FLAT still not. please re-test this case. @elstic

Verified and fixed .