Conversation
…unused parameters
…p_counts from cell load
Summary of ChangesHello @abhinadduri, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly refactors the model architecture by removing several older or less-utilized models, consolidating the focus on the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request performs a significant cleanup of the codebase, removing several legacy model implementations (CPA, scVI, scGPT, OldNeuralOT) and focusing on the StateTransitionPerturbationModel. Key enhancements include the introduction of Negative Binomial (NB) loss support for modeling count data, the addition of cosine learning rate decay, and more flexible optimizer configuration. The refactoring of the decoder logic and checkpoint loading in the base class improves maintainability. However, there is a critical issue in the residual addition logic within StateTransitionPerturbationModel that could lead to shape mismatches during training or inference when the input and output dimensions differ.
| if self.predict_residual and self.output_space == "all": | ||
| # Project control_cells to hidden_dim space to match res_pred | ||
| # control_cells_hidden = self.project_to_hidden(control_cells) | ||
| # treat the actual prediction as a residual sum to basal | ||
| out_pred = self.project_out(res_pred) + basal |
There was a problem hiding this comment.
There is a potential shape mismatch here when predict_residual is enabled and output_space is set to 'all'. In this case, self.project_out(res_pred) will have a feature dimension of output_dim (which is gene_dim for the full transcriptome), while basal has a feature dimension of input_dim (which could be hvg_dim or an embedding dimension). If input_dim != output_dim, the addition will fail with a runtime error. Consider checking if the dimensions match before performing the addition, or projecting basal to the output space.
No description provided.