Skip to content

Conversation

@Ukyeon
Copy link
Contributor

@Ukyeon Ukyeon commented May 9, 2023

  1. optimized the multiprocessing by switching from ThreadPool to a process pool that utilizes cores instead of threads. This change significantly improved the operating time:

    • Previous operating time: 5.573467457999996
    • After optimization time : 2.393449375000003
  2. removed some duplicated code and simplified the existing code.

@Xiaojieqiu
Copy link
Collaborator

this is excellent, Ukyeon! Can you please show me some benchmark on this? Let us also confirm the resulting parameters are the same after your updates?

@Ukyeon
Copy link
Contributor Author

Ukyeon commented May 12, 2023

The resulting parameters are the same after the updates..

est = ss_estimation() # After
est2 = ss_estimation_prev() # Before

np.array_equal(est.parameters["gamma"], est2.parameters["gamma"])
True
np.array_equal(est.aux_param["gamma_intercept"], est2.aux_param["gamma_intercept"])
True
np.array_equal(est.aux_param["gamma_r2"], est2.aux_param["gamma_r2"])
True
np.array_equal(est.aux_param["gamma_logLL"], est2.aux_param["gamma_logLL"])
True
np.array_equal(est.aux_param["bs"], est2.aux_param["bs"])
True
np.array_equal(est.aux_param["bf"], est2.aux_param["bf"])
True

// After
adata.uns["dynamics"]
{'filter_gene_mode': 'final', 't': None, 'group': None, 'X_data': None, 'X_fit_data': None, 'asspt_mRNA': 'ss', 'experiment_type': 'conventional', 'normalized': True, 'model': 'stochastic', 'est_method': 'gmm', 'has_splicing': True, 'has_labeling': False, 'splicing_labeling': False, 'has_protein': False, 'use_smoothed': True, 'NTR_vel': False, 'log_unnormalized': True, 'fraction_for_deg': False}

// Before
adata.uns["dynamics"]
{'filter_gene_mode': 'final', 't': None, 'group': None, 'X_data': None, 'X_fit_data': None, 'asspt_mRNA': 'ss', 'experiment_type': 'conventional', 'normalized': True, 'model': 'stochastic', 'est_method': 'gmm', 'has_splicing': True, 'has_labeling': False, 'splicing_labeling': False, 'has_protein': False, 'use_smoothed': True, 'NTR_vel': False, 'log_unnormalized': True, 'fraction_for_deg': False}

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

Successfully merging this pull request may close these issues.

2 participants