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

Cosine Distance #32

Open
Zeros12 opened this issue Jul 11, 2019 · 4 comments
Open

Cosine Distance #32

Zeros12 opened this issue Jul 11, 2019 · 4 comments

Comments

@Zeros12
Copy link

Zeros12 commented Jul 11, 2019

Hi, thank you for such a nice piece of work.

In Section 4.4 in your paper, it is mentioned that you have calculated the cosine distance between the flattened embedding. If we have 4 images. i.e. f(x1), f(x1'), and f(x2), f(x2') where f(x1) and f(x1') are the real images and generated images in domain X1 and f(x2) and f(x2') are the real images and generated images in domain X2. Can you please suggest did you calculate the cosine distance between f(x1) and f(x1') or between f(x1) and f(x2') or between f(x1) and f(x2) ?

Thanks in advance.

@jerryli27
Copy link
Owner

Hi, thanks for your encouraging words.

Sorry I am not completely sure which part is confusing to you. The cosine distance between two normalized vectors v1 and v2 is defined as 1 - dot_product(v1, v2).

f is the trained encoder, and will thus be different for each domain. From an image, you can get the embedding by taking the output of f, flatten the vector to make it 1 dimensional, then normalize it so that it's length is 1. You do the same thing to the other input image, and you can compute cosine distance using the equation above.

Hopefully that answers your question

@Zeros12
Copy link
Author

Zeros12 commented Jul 15, 2019

Thanks for reply.

I am just confused about that did you calculate the cosine distance between the real images from two domains or between the generated images?

@jerryli27
Copy link
Owner

Between the real images.

@Zeros12
Copy link
Author

Zeros12 commented Jul 17, 2019

Thank you so much.

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

2 participants