Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

[Question] Is Hessian really the metric tensor? #1

Closed
ucalyptus2 opened this issue Jul 7, 2021 · 5 comments
Closed

[Question] Is Hessian really the metric tensor? #1

ucalyptus2 opened this issue Jul 7, 2021 · 5 comments
Labels
question Question and Answer for this project

Comments

@ucalyptus2
Copy link

Hi @Animadversio, great interesting paper.
I read Palais 1957 which you cited when you mentioned that Image manifold will have hessian as the metric tensor. But upon reading the link, I could not find any mention of Hessian. Can you clarify this a bit, please? I'm trying my best to get to understand your paper.

Thanks a lot for the code as well.

@Animadversio
Copy link
Owner

Hi @forkbabu, thanks for your interest and your nice words!

The Palais 1957 is indeed quite obscure, and we found it by pulling a thread from this math overflow question. https://mathoverflow.net/questions/45154/riemannian-metric-induced-by-a-metric
The logic flows in this way, if we know the metric function in the image space (e.g. LPIPS), then we can construct the Riemannian metric tensors from it somehow.
For the Hessian part, you are right that it's not in the Palais paper too. I intuited that relationship at first. The Hessian of squared distance function is locally compatible with the metric function, so I used it as the construction of Riemannian metric.

However, one loophole is that, empirically the LPIPS is not a real metric in the mathematical sense (it can violate triangular inequality). But it's still useful locally as a notion of distance...
Some has argued the perceptual distance does not obey the triangular inequality, too.

@Animadversio
Copy link
Owner

Animadversio commented Jul 16, 2021

I thought about this question a bit more these days.

To add to this discussion, I think the question can be divided into two different issues.

  • Can we legally define a Riemannian manifold using the Hessian as metric tensor as I proposed.
  • Does this Riemannian manifold exhibit a metric structure that is identical to the original metric space.

The first question is simpler, it relies on the Hessian having no zero eigenvalues (there should not be negative eigenvalues, based on the definitions for metric function), i.e. non-degeneracy. Empirically there is usually no zero eigenvalues, but as you see in my paper, there is usually a large space of really small eigenvalues, so numerically, it's quite ill-conditioned/degenerate.
So I think we can define a Riemannian manifold in this way, but it may be pseudo-Riemannian due to the degenerate spectrum...

For the second question, the answer is NO for arbitrary metric function d.
The Riemannian metric tensor used the local properties of the metric function d. So you can imagine two metric functions d1, d2. they are locally identical
d1(x,y)=d2(x,y), when \|x-y\|<=eps
But different outside the neighborhood
d1(x,y)~=d2(x,y), when \|x-y\|>eps
for example, d1 is transformed by a sigmoid like function from d2.
Then d1,d2 will induce the same metric tensor, but the metric structure Riemmannian manifold cannot be identical to both d1, d2

So back to the paper, the geodesic distance on the Riemannian manifold defined as I did, is not the LPIPS distance, though they may be close locally.
Numerically as I tried, they are not the same.....

@Animadversio Animadversio pinned this issue Jul 17, 2021
@zeyuyun1
Copy link

I hope this is not a dumb question... When you motivate to use Hessian to approximate construct the metric tensor (equation 1), I assume the motivation is from Taylor's theorem. If so, why do you ignore the first-order approximation and use only the second-order approximation term?

@Animadversio
Copy link
Owner

@zeyuyun1 Thanks for your interest!

The short answer is the first-order term is always 0 in that form of expansion.
We are expanding d(z,z+dz) w.r.t. dz at dz=0.
This function is positive definite w.r.t. dz, so dz=0 is a local and global minimum for the function.
The first-order derivative vanishes at local minima.

@zeyuyun1
Copy link

oh I see. Thank you!!

Repository owner locked and limited conversation to collaborators Oct 12, 2021
@Animadversio Animadversio unpinned this issue May 10, 2022
@Animadversio Animadversio pinned this issue May 10, 2022
@Animadversio Animadversio added the question Question and Answer for this project label Mar 31, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
question Question and Answer for this project
Projects
None yet
Development

No branches or pull requests

3 participants