SPACEL.Spoint.base_model.SpointModel.train

SpointModel.train(max_steps=5000, save_mode='all', save_path=None, prefix=None, sm_step=10, st_step=10, test_step_gap=1, convergence=0.001, early_stop=False, early_stop_max=2000, sm_lr=None, st_lr=None, batch_size=1024, rec_w=1, infer_w=1, m_w=1, scvi_max_epochs=100, scvi_early_stopping=True, scvi_batch_size=4096)

Training Spoint model.

Obtain latent feature from scVI then feed in Spoint model for training.

Parameters:
  • max_steps – The max step of training. The training process will be stop when achive max step.

  • save_mode – A string determinates how the model is saved. It must be one of ‘best’ and ‘all’.

  • save_path – A string representing the path directory where the model is saved.

  • prefix – A string added to the prefix of file name of saved model.

  • convergence – The threshold of early stop.

  • early_stop – If True, turn on early stop.

  • early_stop_max – The max steps of loss difference less than convergence.

  • sm_lr – Learning rate for simulated data.

  • st_lr – Learning rate for spatial transcriptomic data.

  • batch_size – Batch size of the data be feeded in model once.

  • rec_w – The weight of reconstruction loss.

  • infer_w – The weig ht of inference loss.

  • m_w – The weight of MMD loss.

  • scvi_max_epochs – The max epoch of scVI.

  • scvi_batch_size – The batch size of scVI.

Returns:

None