Switch default optimizer to CG with multi-start#1284
Open
Marius1311 wants to merge 2 commits intomainfrom
Open
Switch default optimizer to CG with multi-start#1284Marius1311 wants to merge 2 commits intomainfrom
Marius1311 wants to merge 2 commits intomainfrom
Conversation
Allow users to choose the optimization method for the GPCCA rotation matrix via the new 'optimizer' parameter. Valid options: 'Nelder-Mead' (default), 'L-BFGS-B', 'BFGS', 'CG'. Warns when using Nelder-Mead with n_states > 15 as it scales poorly.
- Change default optimizer from Nelder-Mead to CG (conjugate gradient) - Change default n_starts from 1 to 10 with perturbation_scale=0.1 - Add n_starts, perturbation_scale, seed parameters to compute_macrostates - Forward optimizer parameters from fit() to compute_macrostates() - Update docstrings with factual complexity descriptions - Add .gitignore entries for uv.lock and .github/prompts/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Switch the default GPCCA rotation optimizer from Nelder-Mead to conjugate gradient (CG) with 10 random restarts. This makes
compute_macrostates()scale to large numbers of macrostates (m > 15) where Nelder-Mead becomes impractical.Changes
"Nelder-Mead"→"CG"1→10(withperturbation_scale=0.1)compute_macrostates():n_starts,perturbation_scale,seed— these were already supported by pyGPCCA but not exposed in CellRankfit()method: Now forwards optimizer parameters tocompute_macrostates()(previously always used hardcoded defaults)uv.lockand.github/prompts/Benchmark results
Validated on pancreas (2,531 cells) and bone marrow (5,780 cells) datasets:
Dependencies
Requires pyGPCCA from
msmdev/pyGPCCAbranchfeature/gradient-optimizationwhich implements the analytical Jacobian and multi-start SO(k) rotation perturbation.