basiralab / RegGNN

Regression Graph Neural Network (regGNN) for cognitive score prediction.
66 stars 18 forks source link

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

Open yashwanth850 opened 1 year ago

yashwanth850 commented 1 year ago

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]"?

marifdemirtas commented 1 year ago

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 commented 1 year ago

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 commented 1 year ago

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.