SCANVI.train(max_epochs=None, n_samples_per_label=None, check_val_every_n_epoch=None, train_size=0.9, validation_size=None, batch_size=128, use_gpu=None, plan_kwargs=None, **trainer_kwargs)[source]

Train the model.

max_epochs : int | NoneOptional[int] (default: None)

Number of passes through the dataset for semisupervised training.

n_samples_per_label : float | NoneOptional[float] (default: None)

Number of subsamples for each label class to sample per epoch. By default, there is no label subsampling.

check_val_every_n_epoch : int | NoneOptional[int] (default: None)

Frequency with which metrics are computed on the data for validation set for both the unsupervised and semisupervised trainers. If you’d like a different frequency for the semisupervised trainer, set check_val_every_n_epoch in semisupervised_train_kwargs.

train_size : floatfloat (default: 0.9)

Size of training set in the range [0.0, 1.0].

validation_size : float | NoneOptional[float] (default: 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 : intint (default: 128)

Minibatch size to use during training.

use_gpu : str | int | bool | NoneUnion[str, int, bool, None] (default: 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).

plan_kwargs : dict | NoneOptional[dict] (default: None)

Keyword args for SemiSupervisedTrainingPlan. Keyword arguments passed to train() will overwrite values present in plan_kwargs, when appropriate.


Other keyword args for Trainer.