Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creating test data for similarity measure #27

Open
maaeedee opened this issue May 12, 2021 · 0 comments
Open

Creating test data for similarity measure #27

maaeedee opened this issue May 12, 2021 · 0 comments

Comments

@maaeedee
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant