sensein / mapalign

Diffusion map based embedding and alignment
Other
68 stars 28 forks source link

embded.compute_diffusion_map 's vectors is stuck into a cycle of positive and negative value #16

Closed YaoMeng94 closed 5 years ago

YaoMeng94 commented 5 years ago

when I run the "emb, res =embded.compute_diffusion_map(aff, alpha=0.5, return_result = True)", which the "aff" is a 800×800 symmetrical matrix, it return the res with the "vectors" and "emb", if some value of the two array is positive for the first time, and then run the function again it will be negative with the almost same absolute value, I am quit confused about this problem and when I run a lot of matrix it will bring inconsistency, and it will be quite tricky to my work which is about the compute of gradient of human brain functional connectivity. I wish some help can be available for me.

YaoMeng94 commented 5 years ago

By the way the "aff" matrix is non-negative and sparse, is it the problem arise from the small matrix and I looking fan the answer of stabilizing the result

satra commented 5 years ago

@DearBraveJohn - the sign (direction of an eigenvector) of an eigendecomposition is not guaranteed from run to run. depending on your use case, you can flip the direction, or if you are comparing to some template or to another individual or even to the same individual, you can use the alignment algorithms.

YaoMeng94 commented 5 years ago

thanks for the answer, and specifically how did the alignment algorithms which I have no knowledge about work for this

satra commented 5 years ago

here is some info:

thus the current alignment algorithm makes a few assumptions:

  1. the functional modes or components are equivalent across individuals
  2. there is a linear transform/mapping between these components.
YaoMeng94 commented 5 years ago

thanks for the tips, problem already solved.