scvelo.tl.VELOVI.train¶
-
VELOVI.
train
(max_epochs=500, lr=0.01, weight_decay=0.01, use_gpu=None, accelerator='auto', devices='auto', train_size=0.9, validation_size=None, batch_size=256, early_stopping=True, gradient_clip_val=10, plan_kwargs=None, **trainer_kwargs)¶ Train the model.
- Parameters
- max_epochs :
int
,None
Number of passes through the dataset. If None, defaults to np.min([round((20000 / n_cells) * 400), 400])
- lr :
float
Learning rate for optimization
- weight_decay :
float
Weight decay for optimization
- use_gpu :
str
,int
,bool
,None
Use default GPU if available (if None or True), or index of GPU to use (if int), or name of GPU (if str, e.g., ‘cuda:0’), or use CPU (if False).
- train_size :
float
Size of training set in the range [0.0, 1.0].
- validation_size :
float
,None
Size of the test set. If None, defaults to 1 - train_size. If train_size + validation_size < 1, the remaining cells belong to a test set.
- batch_size :
int
Minibatch size to use during training.
- early_stopping :
bool
Perform early stopping. Additional arguments can be passed in **kwargs. See
Trainer
for further options.- gradient_clip_val :
float
Val for gradient clipping
- plan_kwargs :
dict
,None
Keyword args for
TrainingPlan
. Keyword arguments passed to train() will overwrite values present in plan_kwargs, when appropriate.- **trainer_kwargs
Other keyword args for
Trainer
.
- max_epochs :