stereo.algorithm.ms_spa_track.MSSpaTrack.gr_training

MSSpaTrack.gr_training(data1_index, data2_index, tfs_path=None, min_cells_1=None, min_cells_2=None, cell_select_per_time=10, cell_generate_per_time=500, train_ratio=0.8, use_gpu=True, random_state=0, training_times=10, iter_times=30, mapping_num=3000, filename='weights.csv', lr_ratio=0.1)[source]

Create and run a trainer for gene regulatory network training in 2_time mode(two samples).

Parameters:
  • data1_index (Union[str, int]) – The index in the ms_data of the first data

  • data2_index (Union[str, int]) – The index in the ms_data of the second data

  • tfs_path (Optional[str]) – The path of the tf names file, defaults to None

  • min_cells_1 (Optional[int]) – The minimum number of cells for filtering the first data

  • min_cells_2 (Optional[int]) – The minimum number of cells for filtering the second data

  • cell_select_per_time (int) – The number of randomly selected cells at each time point, defaults to 10

  • cell_generate_per_time (int) – The number of cells generated at each time point, defaults to 500

  • train_ratio (float) – Ratio of training data, defaults to 0.8

  • use_gpu (bool) – Whether to use gpu, by default, to use if available.

  • random_state (int) – Random seed of numpy and torch, fixed for reproducibility, defaults to 0

  • training_times (int) – Number of times to randomly initialize the model and retrain, defaults to 10

  • iter_times (int) – The number of iterations for each training model, defaults to 30

  • mapping_num (int) – The number of top weight pairs you want to extract, defaults to 3000

  • filename (str) – The name of the file to save the weights, defaults to “weights.csv”

  • lr_ratio (float) – The learning rate, defaults to 0.1

Returns:

A trainer object for gene regulatory network training.