scvi.model.get_max_epochs_heuristic

scvi.model.get_max_epochs_heuristic#

scvi.model.get_max_epochs_heuristic(n_obs, epochs_cap=400, decay_at_n_obs=20000)[source]#

Compute a heuristic for the default number of maximum epochs.

If n_obs <= decay_at_n_obs, the number of maximum epochs is set to epochs_cap. Otherwise, the number of maximum epochs decays according to (decay_at_n_obs / n_obs) * epochs_cap, with a minimum of 1. Raises a warning if the number of maximum epochs is set to 1.

Parameters:
  • n_obs (int) – The number of observations in the dataset.

  • epochs_cap (int (default: 400)) – The maximum number of epochs for the heuristic.

  • decay_at_n_obs (int (default: 20000)) – The number of observations at which the heuristic starts decaying.

Return type:

int

Returns:

A heuristic for the number of maximum training epochs.