% Generate or load an evaluation set (query+learn+base)
%
% This software is governed by the CeCILL license under French law and
% abiding by the rules of distribution of free software.
% See http://www.cecill.info/licences.en.html
if strcmp (dataset, 'random')
% synthetic dataset
d = 16;
% Generate a set of unit norm vectors
ntrain = 10000;
nbase = 1000000;
nquery = 1000;
vtrain = single (rand (d, ntrain));
vbase = single (rand (d, nbase));
vquery = single (rand (d, nquery));
% Compute the ground-truth
t0 = cputime;
[ids_gnd, dis_gnd] = yael_nn (vbase, vquery, 1);
tgnd = cputime - t0;
else
switch dataset
case 'siftsmall'
basedir = './siftsmall/' ; % modify this directory to fit your configuration
fbase = [basedir 'siftsmall_base.fvecs'];
fquery = [basedir 'siftsmall_query.fvecs'];
ftrain = [basedir 'siftsmall_learn.fvecs'];
fgroundtruth = [basedir 'siftsmall_groundtruth.ivecs'];
case 'sift'
basedir = './sift/' ; % modify this directory to fit your configuration
fbase = [basedir 'sift_base.fvecs'];
fquery = [basedir 'sift_query.fvecs'];
ftrain = [basedir 'sift_learn.fvecs'];
fgroundtruth = [basedir 'sift_groundtruth.ivecs'];
case 'gist'
basedir = './gist/' ; % modify this directory to fit your configuration
fbase = [basedir 'gist_base.fvecs'];
fquery = [basedir 'gist_query.fvecs'];
ftrain = [basedir 'gist_learn.fvecs'];
fgroundtruth = [basedir 'gist_groundtruth.ivecs'];
end
% Read the vectors
vtrain = fvecs_read (ftrain);
vbase = fvecs_read (fbase);
vquery = fvecs_read (fquery);
ntrain = size (vtrain, 2);
nbase = size (vbase, 2);
nquery = size (vquery, 2);
d = size (vtrain, 1);
% Load the groundtruth
ids = ivecs_read (fgroundtruth);
ids_gnd = ids (1, :) + 1; % matlab indices start at 1
end
没有合适的资源?快使用搜索试试~ 我知道了~
product quantization SDC算法在Windows下的实现
共19个文件
m:14个
mexw64:4个
readme:1个
需积分: 13 19 下载量 30 浏览量
2016-08-15
20:53:38
上传
评论
收藏 752KB RAR 举报
温馨提示
这是product quantization中对SDC距离计算Windows下matlab实现代码。
资源推荐
资源详情
资源评论
收起资源包目录
SDC.rar (19个子文件)
SDC
SDC_MAIN.m 1KB
pq_vquery_assign.m 445B
pq_assign.m 759B
train.m 2KB
sample_mvgm.mexw64 34KB
yael_kmin.m 1KB
ndellipse.mexw64 30KB
pq_new.m 2KB
yael_nn.m 2KB
yael_kmeans.mexw64 3.86MB
pq_test_compute_stats.m 1KB
yael_L2sqr.m 860B
sumidxtab.mexw64 8KB
ivecs_read.m 1KB
fvecs_read.m 1KB
yael_kmeans.m 1KB
README 132B
pq_search.m 2KB
pq_test_load_vectors.m 2KB
共 19 条
- 1
资源评论
三更灯火五更鸡
- 粉丝: 144
- 资源: 14
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功