Closed AprilYuge closed 1 year ago
Hi Yuge! Thanks for the report.
I'm afraid the first fix is not necessary, as Classifier
directly inherits from torch.nn.Linear
, it will work just fine.
The second problem is valid though and the fix is correct. However, scglue.models.glue.GLUE
does not define u2c
, only scglue.models.scglue.SCGLUE
does, so I guess it makes more sense to put the fix in scglue.models.scglue.SCGLUETrainer
(scglue.py:L205). Also, the same issue exists for SCCLUE (scclue.py:L600). Do you wish to create a pull request for that? Or if you're busy with other work I can fix it myself.
Thanks again for the report and proposed fixes! These are important issues.
Hi Zhijie,
Thanks for your reply! You are right that Classifier
should be fine by inherting from torch.nn.Linear
. For the second point, I modified inside GLUETrainer
instead of scGLUETrainer
because that's where self.vae_optim
is defined, but we can also overwrite that inside scGLUETrainer
if self.net.u2c
is not None
.
I can submit a pull request these days.
Best,
Yuge
Well that's great! I'd prefer the fix inside scglue.py
and scclue.py
, and preserve glue.py
as a reference implementation of the framework that does not involve supervised classification. Let me know when you have the PR ready.
Hi Zhijie,
Sorry for the late reply. I just submitted a PR for this issue. Take a look when you have time.
Thanks,
Yuge
Thank you for the contribution! I have merged the PR.
Hi,
I found some code are missing for supervised/semi-supervised version of scGLUE when use_cell_type is given.
The Classifier in sc.py is missing (line 480). My modification: class Classifier(torch.nn.Module):
The parameters of self.net.u2c are not included in the self.vae_opt in glue.py (line 321-328). My modification:
Best,
Yuge