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

issue with self.rho = nn.ParameterDict(self.rho) #31

Open
deanslee opened this issue Oct 21, 2023 · 2 comments
Open

issue with self.rho = nn.ParameterDict(self.rho) #31

deanslee opened this issue Oct 21, 2023 · 2 comments

Comments

@deanslee
Copy link

deanslee commented Oct 21, 2023

Hi all, I was running through the code below in the provided tutorial and came across an error.

model = Spectra.est_spectra(adata=adata, gene_set_dictionary=annotations, use_highly_variable=True, cell_type_key="cell_type_annotations", use_weights=True, lam=0.1, delta=0.001, kappa=None, rho=0.001, use_cell_types=True, n_top_vals=50, label_factors=True, overlap_threshold=0.2, clean_gs=True, min_gs_num=3, num_epochs=2)

Screenshot 2023-10-20 at 10 58 46 PM
Screenshot 2023-10-20 at 10 59 07 PM

When rho=None, est_spectra runs just fine.
The same error with rho=0.001 also happens with kappa=0.001.

@deanslee
Copy link
Author

I might be wrong, but my current understanding is that the issue with nn.ParameterDict(self.rho) is that self.rho needs to be two dimensions.

This is my attempt to reproduce the error:

Screenshot 2023-10-20 at 11 07 09 PM

Then running self_rho = nn.ParameterDict(self_rho) reproduces

TypeError: cannot assign 'torch.DoubleTensor' object to parameter 'B_GC' (torch.nn.Parameter or None required)

@deanslee
Copy link
Author

Could this issue be a result of this commit?

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

1 participant