Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tutorial for the or snipet for case where we only have 1 modality #44

Open
M0hammadL opened this issue Jan 24, 2022 · 1 comment
Open
Assignees

Comments

@M0hammadL
Copy link
Member

The way to enocde the data and dataloader for single-modality datasets is not clear

@Nusob888
Copy link

Hi all, great tool! Just checking if any update on this?

I have tried a few variations to input only scRNAseq data by itself with no other modes, but the model seems to fail to fully train.

I am doing the following:

`
adata = mtm.data.organize_multimodal_anndatas(
adatas=[[adata_ref]], # a list of anndata objects per modality, RNA-seq always goes first
layers=[["counts"]], # if need to use data from .layers, if None use .X
)

adata_indices_end = adata.shape[1]

mtm.model.MultiVAE.setup_anndata(
adata,
categorical_covariate_keys=["batch"],
rna_indices_end= adata_indices_end,
)

vae = mtm.model.MultiVAE(
adata,
losses=["nb"],
)

vae.train()
`

I get the following error:
Expected parameter loc (Tensor of shape (256, 16)) of distribution Normal(loc: torch.Size([256, 16]), scale: torch.Size([256, 16])) to satisfy the constraint Real(), but found invalid values:
tensor([[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
...,
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan],
[nan, nan, nan, ..., nan, nan, nan]], device='cuda:0',
grad_fn=)

Which I presume has something to do with my single modality approach, as I can train the same dataset using scVI, MultiVI and scPoli fine (with the same hvg selections and preprocessing).

Any help would be much appreciated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants