jsxlei / SCALEX

Online single-cell data integration through projecting heterogeneous datasets into a common cell-embedding space
BSD 3-Clause "New" or "Revised" License
72 stars 18 forks source link

Uncorrect representation assignment? #13

Closed biosyssun closed 1 year ago

biosyssun commented 2 years ago

Hi lei,

I have a question about representation caluculation.

In line102 and line 115 of vae.py, representation is infered by z = self.encoder(x)[1] # z, mu, var. Since self.encoder return a three-element tuple, it seems that mu was assigned to z.

I don't understand why you do like this?

Thank you very much.

jsxlei commented 2 years ago

Hi, Of couse it is totally correct using z to represent cells. Here is just a small trick. z = mu + std, where mu is the center point without the small deviations, and it would be a little bit better using mu than using z in inference process to infer the cell representations, which will make the representations more contracted.

biosyssun commented 2 years ago

Thank you very much for your reply. I understand your rationale.