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

Why channel-wisely compute feature map L2 distance? #54

Closed
Yunzhi-b opened this issue Nov 3, 2020 · 1 comment
Closed

Why channel-wisely compute feature map L2 distance? #54

Yunzhi-b opened this issue Nov 3, 2020 · 1 comment

Comments

@Yunzhi-b
Copy link

Yunzhi-b commented Nov 3, 2020

Hi, LPIPS helps me a lot in image translation task! There's one question that I could not figure it out by myself. For feature map distance, why the paper computes L2 distance channel-wisely and then averages spatially? Could we compute L2 distance spatially(flatten feature map for one channel, and compute L2 distance) and then average over channels?

Thanks!

@richzhang
Copy link
Owner

richzhang commented Nov 3, 2020

We average over the spatial dimensions, so that the metric is in roughly the same range of values, no matter the size of the image. The unweighted version is also equivalent to cosine distance in the channel direction.

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