Creating test data for similarity measure
Opened this issue · 0 comments
maaeedee commented
Hi,
I need to run the experiment for the self and similarity measure. I could not find these experiments in the Jupyter notebook.
I first need to create the Ta
and Tb
in the following lines:
## self-similarity
Tb = h5open("trj.h5", "r") do f
read(f["layer3"])
end
Ta = h5open("trj-distort06.h5", "r") do f
read(f["layer3"])
end
d = colwise(Euclidean(), Ta, Tb)
mean(d)
### cross-similarity
da = colwise(Euclidean(), Ta, Ta[:, end:-1:1])
db = colwise(Euclidean(), Tb, Tb[:, end:-1:1])
mean(abs(db - da) ./ db)
For that mean, I'm using the following piece of code to create Ta (after applying t2vec to vecfile):
## Creating test files for similarity computation.
prefix = "exp1"
do_split = true
start = 1_000_000+20_000
num_query = 1000
num_db = 100_000
querydbfile = joinpath(datapath, "$prefix-querydb.h5")
tfile = joinpath(datapath, "$prefix-trj.t")
labelfile = joinpath(datapath, "$prefix-trj.label")
vecfile = joinpath(datapath, "$prefix-trj.h5")
createQueryDB("$datapath/$cityname.h5", start, num_query, num_db,
(x, y)->(x, y),
(x, y)->(x, y);
do_split=do_split,
querydbfile=querydbfile)
createTLabel(region, querydbfile; tfile=tfile, labelfile=labelfile)
But still, I need to create 'Tb'. COuld you please help me to create this dataset?