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 is the index fixed to 0 while creating features #5

Open
yashwanth850 opened this issue Jan 19, 2023 · 3 comments
Open

Why is the index fixed to 0 while creating features #5

yashwanth850 opened this issue Jan 19, 2023 · 3 comments

Comments

@yashwanth850
Copy link

Line 54 in data.utils.py file :
"dist = spd.transp(data[:, :, 0] + np.eye(Config.ROI) * 1e-10, data[:, :, i] + np.eye(Config.ROI) * 1e-10,
spd.log(data[:, :, i] + np.eye(Config.ROI) * 1e-10, data[:, :, j] + np.eye(Config.ROI) * 1e-10))"
I don't understand why "data[:, :, 0]" is used instead of "data[:, :, I]"?

@yashwanth850 yashwanth850 changed the title Why is the index fixed to 0 while creatingfeatures Why is the index fixed to 0 while creating features Jan 19, 2023
@marifdemirtas
Copy link
Contributor

Hi,

The line in question transports the matrices for each index to a common point, which is arbitrarily selected as the first sample of the dataset. Due to geometric properties of the connectomes, the index choice for the first argument here does not affect the method. See Fig.1 in our paper, the SPD implementation by morphomatics for details.

@yashwanth850
Copy link
Author

Thanks got it.

I have another doubt here. When I look into the spd.transp(S,T,X) function, it is just returning the X without doing anything. Can you tell me why it is that way?

@marifdemirtas
Copy link
Contributor

That is a property of the symmetric positive definite (SPD) manifold. If you look at the definition of parallel transport for other manifolds in the morphomatics repo (e.g. SO3.py), you will see different operations. Thanks to their representation of tangent vectors, transport operation for SPD is simply the identity function. We could calculate the distances as dist = spd.log(...) directly, but we preferred to use their API to improve readability, as we mention parallel transport explicitly in the paper.

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