scvi.external.CellAssign.train

CellAssign.train(max_epochs=400, lr=0.003, use_gpu=None, train_size=0.9, validation_size=None, batch_size=1024, plan_kwargs=None, early_stopping=True, early_stopping_patience=15, early_stopping_min_delta=0.0, **kwargs)[source]

Trains the model.

Parameters
max_epochs : intint (default: 400)

Number of epochs to train for

lr : floatfloat (default: 0.003)

Learning rate for optimization.

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).

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: 1024)

Minibatch size to use during training.

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

Keyword args for ClassifierTrainingPlan. Keyword arguments passed to

early_stopping : boolbool (default: True)

Adds callback for early stopping on validation_loss

early_stopping_patience : intint (default: 15)

Number of times early stopping metric can not improve over early_stopping_min_delta

early_stopping_min_delta : floatfloat (default: 0.0)

Threshold for counting an epoch torwards patience train() will overwrite values present in plan_kwargs, when appropriate.

**kwargs

Other keyword args for Trainer.