% load the vectors from test/training/query sets, and the groundtruth
% if dataset='random', a random dataset is generated on the fly
% ='siftsmall', the siftsmall is used (from basedir directory)
% ='sift', the sift dataset is used (frome basedir directory)
% ='gist', the sift dataset is used (frome basedir directory)
dataset = 'sift';
pq_test_load_vectors;
%---[ Search parameters ]---
k = 10000; % number of elements to be returned
nsq = 8; % number of subquantizers to be used (m in the paper)
k_prime = 1024;
% Learn the Coarse quantizer code structure
t0 = cputime;
cq = cq_new (k_prime, vtrain);
cq_vtrain_idx = cq_assign (vtrain,cq);
residual_train = residual_vector (vtrain,cq,cq_vtrain_idx);
tcqlearn = cputime - t0;
% Learn the PQ code structure
t0 = cputime;
pq = pq_new (nsq, residual_train);
tpqlearn = cputime - t0;
% encode the database vectors
t0 = cputime;
cq_vbase_idx = cq_assign (vbase,cq);
ivf_cq_base = ivf_pq_assign(vbase,cq,k_prime,pq);
tpqencode = cputime - t0;
%---encode the vquery vectors---
% t0 = cputime;
% pq_vquery = pq_vquery_assign(pq,vquery);
% tpqqueryencode = cputime - t0;
%---[ perform the search and compare with the ground-truth ]---
t0 = cputime;
%[ids_pqc, dis_pqc] = pq_search (pq, cbase, pq_vquery, k); %SDC
%query_residual = residual_vector (vquery,cq,cq_vbase_idx); %ADC
for w =[1,16]
[idx, dis] = yael_nn (cq, vquery, w, 2);
[ids_pqc, dis_pqc] = ivf_pq_search (pq, ivf_cq_base, vquery, k,idx,cq); %ADC
%[ids_pqc, dis_pqc] = pq_search (pq, cbase, vquery, k); %ADC
% compute search statistics
pq_test_compute_stats
end
% fprintf ('SDC learn = %.3f s\n', tpqlearn);
% fprintf ('SDC encode = %.3f s\n', tpqencode);
% fprintf ('SDC encodequery = %.3f s\n', tpqqueryencode);
% fprintf ('SDC search = %.3f s for %d query vectors in a database of %d vectors\n', tpq, nquery, nbase);
%load('share.mat')
没有合适的资源?快使用搜索试试~ 我知道了~
product quantization IVFADC算法在Windows下的实现
共25个文件
m:19个
mexw64:4个
readme:1个
需积分: 12 21 下载量 160 浏览量
2016-08-15
20:56:16
上传
评论
收藏 759KB RAR 举报
温馨提示
这是 product quantization算法IVFADC在Windows下的matlab源码实现
资源推荐
资源详情
资源评论
收起资源包目录
IVFADC.rar (25个子文件)
IVFADC
ivf_pq_search.m 1KB
pq_vquery_assign.m 445B
yael_kmin.m 1KB
pq_test_load_vectors.m 2KB
ivf_pq_assign.m 762B
yael_kmeans.m 1KB
cq_assign.m 126B
pq_search.m 2KB
pq_new.m 2KB
cq_new.m 662B
sample_mvgm.mexw64 34KB
pq_test_compute_stats.m 978B
yael_L2sqr.m 860B
ivecs_read.m 1KB
ndellipse.mexw64 30KB
yael_nn.m 2KB
sumidxtab.mexw64 8KB
residual_vector.m 231B
train.m 2KB
pq_assign.m 759B
IVFADC_MAIN.m 2KB
README 135B
fvecs_read.m 1KB
QQ截图20160814160414.png 6KB
yael_kmeans.mexw64 3.86MB
共 25 条
- 1
资源评论
三更灯火五更鸡
- 粉丝: 144
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功