dynamo-release icon indicating copy to clipboard operation
dynamo-release copied to clipboard

ss estimate refactor

Open Ukyeon opened this issue 1 year ago • 2 comments

  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.

Ukyeon avatar May 09 '23 23:05 Ukyeon

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?

Xiaojieqiu avatar May 10 '23 00:05 Xiaojieqiu

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}

Ukyeon avatar May 12 '23 22:05 Ukyeon