-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdata_batch.m
More file actions
50 lines (42 loc) · 1.61 KB
/
Copy pathdata_batch.m
File metadata and controls
50 lines (42 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
% Version 1.000
%
% Code provided by gyn
%
% Permission is granted for anyone to copy, use, modify, or distribute this
% program and accompanying programs and documents for any purpose, provided
% this copyright notice is retained and prominently displayed, along with
% a note saying that the original programs are available from our
% web page.
% The programs and documents are distributed without any warranty, express or
% implied. As the programs were written for research purposes only, they have
% not been tested to the degree that would be advisable in any important
% application. All use of these programs is entirely at the user's own risk.
dim = 6198;
corpusdata = load_matrix('matFiles/1_matrix_of_zhidao_ty.txt', dim);
totnum = size(corpusdata,1);
fprintf(1, 'Size of the training dataset= %5d \n', totnum);
disp('batching training data...')
numbatches = totnum/9901;
numdims = dim; %size(corpusdata,2);
batchsize = 9901;
batchdata = zeros(batchsize, numdims, numbatches);
for b=1:numbatches
batchdata(:,:,b) = corpusdata((b-1)*batchsize+1:b*batchsize,:);
end;
clear corpusdata
querydata = load_matrix('matFiles/1_matrix_of_zhidao.que',dim);
totnum=size(querydata,1);
fprintf(1, 'Size of the query dataset= %5d \n', totnum);
querysize = 2045;
numbatches = totnum/querysize;
numdims = dim; %size(querydata,2);
batchsize = querysize;
testbatchdata = zeros(batchsize, numdims, numbatches);
disp('batching query data...')
for b=1:numbatches
testbatchdata(:,:,b) = querydata((b-1)*batchsize+1:b*batchsize,:);
end;
clear querydata querysize
%%% Reset random seeds
rand('state',sum(100*clock));
randn('state',sum(100*clock));