当前“encodeResidual”在“metric=faiss::MetricType::METRIC_INNER_PRODUCT”下,仅支持“false”取值,即当前并不支持对残差编码的IVFSQ方法,当取值为“true”时能够运行成功但存在精度问题。
API定义 |
AscendIndexIVFSQ(int dims, int nlist, faiss::ScalarQuantizer::QuantizerType qtype = ScalarQuantizer::QuantizerType::QT_8bit, faiss::MetricType metric = MetricType::METRIC_L2, bool encodeResidual = true, AscendIndexIVFSQConfig config = AscendIndexIVFSQConfig()); |
---|---|
功能描述 |
AscendIndexIVFSQ的构造函数,生成AscendIndexIVFSQ,此时根据“config”中配置的值设置Device侧资源。 |
输入 |
int dims:AscendIndexIVFSQ管理的一组特征向量的维度。 int nlist:聚类中心的个数,与算子生成脚本中的“coarse_centroid_num”参数对应。 faiss::ScalarQuantizer::QuantizerType qtype:AscendIndexIVFSQ的量化器类型。 faiss::MetricType metric:AscendIndex在执行特征向量相似度检索的时候使用的距离度量类型。 bool encodeResidual:表示是否对残差编码。 AscendIndexIVFSQConfig config:Device侧资源配置。 |
输出 |
无 |
返回值 |
无 |
约束说明 |
|