theislab / cpa

The Compositional Perturbation Autoencoder (CPA) is a deep generative framework to learn effects of perturbations at the single-cell level. CPA performs OOD predictions of unseen combinations of drugs, learns interpretable embeddings, estimates dose-response curves, and provides uncertainty estimates.
BSD 3-Clause "New" or "Revised" License
83 stars 17 forks source link

tutorial CPAModule.init #18

Closed fran-mora closed 1 year ago

fran-mora commented 1 year ago

Hi all, great work. Trying to run this function from the tutorial. Have passed test arguments and geting the error below. Any clue? Seems like the packages could have been updated but the tutorial still failing to call the functions properly maybe?

Tutorial

Thanks a lot!

model = cpa.CPA(adata=adata, n_latent=64, loss_ae='gauss', doser_type='logsigm', split_key='split', train_split='train', valid_split='test', test_split='ood', **ae_hparams, )


TypeError Traceback (most recent call last) in <cell line: 1>() ----> 1 model = cpa.CPA(adata=adata, 2 n_latent=64, 3 loss_ae='gauss', 4 doser_type='logsigm', 5 split_key='split',

/usr/local/lib/python3.10/dist-packages/cpa/_model.py in init(self, adata, split_key, train_split, valid_split, test_split, **hyper_params) 99 } 100 --> 101 self.module = CPAModule( 102 n_genes=adata.n_vars, 103 n_perts=len(self.pert_encoder),

TypeError: CPAModule.init() got an unexpected keyword argument 'loss_ae'

AxKo commented 1 year ago

I have the same problem. The tutorial seems to be written for v0.1 and the current version 0.5 is very different. Looking into the v0.5 code one can see that loss_ae is now called recon_loss, but the real problem is that the parameters in ae_hparams and trainer_params are now very different :-(

PLEASE, somebody update the tutorial so that it works with v0.5 !!