theislab / chemCPA

Code for "Predicting Cellular Responses to Novel Drug Perturbations at a Single-Cell Resolution", NeurIPS 2022.
https://arxiv.org/abs/2204.13545
MIT License
88 stars 23 forks source link

Finetuning to SciPlex dataset. #108

Closed reem12345 closed 1 year ago

reem12345 commented 1 year ago

When I try to finetune from LINCS to SciPlex, I got an error because the covariates embedding of LINCS has [82,32] and SciPlex includes only 3 cell lines.

siboehm commented 1 year ago

Thanks for raising another issue! If you want help, please post as much context as possible. Which code were you running? What was the error that you got? How did you setup the datasets?

reem12345 commented 1 year ago

I trained the model on LINCS Dataset. and I want to fine-tune on SciPlex dataset. But I got this error: RuntimeError: Error(s) in loading state_dict for Embedding: size mismatch for weight: copying a param with shape torch.Size([82, 32]) from checkpoint, the shape in current model is torch.Size([3, 32]).

siboehm commented 1 year ago

IIRC in our experiments we do not carry over the covariates when finetuning a LINCS models, but retrain a new embedding from scratch (the embedding is so small anyway).

Without seeing any code I can't really help you more here.

MxMstrmn commented 1 year ago

Simon is correct, the shapes you describe correspond to the cell line embeddings and we did not transfer those for fine-tuning. Removing the embedding with shape torch.Size([82, 32]) should resolve the issue.